@vm0/cli 9.62.0 → 9.62.2
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/index.js +521 -859
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -45,7 +45,7 @@ if (DSN) {
|
|
|
45
45
|
Sentry.init({
|
|
46
46
|
dsn: DSN,
|
|
47
47
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
48
|
-
release: "9.62.
|
|
48
|
+
release: "9.62.2",
|
|
49
49
|
sendDefaultPii: false,
|
|
50
50
|
tracesSampleRate: 0,
|
|
51
51
|
shutdownTimeout: 500,
|
|
@@ -64,7 +64,7 @@ if (DSN) {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
Sentry.setContext("cli", {
|
|
67
|
-
version: "9.62.
|
|
67
|
+
version: "9.62.2",
|
|
68
68
|
command: process.argv.slice(2).join(" ")
|
|
69
69
|
});
|
|
70
70
|
Sentry.setContext("runtime", {
|
|
@@ -673,7 +673,7 @@ function getConfigPath() {
|
|
|
673
673
|
return join2(homedir2(), ".vm0", "config.json");
|
|
674
674
|
}
|
|
675
675
|
var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
|
|
676
|
-
console.log(chalk4.bold(`VM0 CLI v${"9.62.
|
|
676
|
+
console.log(chalk4.bold(`VM0 CLI v${"9.62.2"}`));
|
|
677
677
|
console.log();
|
|
678
678
|
const config = await loadConfig();
|
|
679
679
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -965,7 +965,8 @@ var composesMainContract = c.router({
|
|
|
965
965
|
responses: {
|
|
966
966
|
200: composeResponseSchema,
|
|
967
967
|
400: apiErrorSchema,
|
|
968
|
-
401: apiErrorSchema
|
|
968
|
+
401: apiErrorSchema,
|
|
969
|
+
403: apiErrorSchema
|
|
969
970
|
},
|
|
970
971
|
summary: "Get agent compose by name"
|
|
971
972
|
},
|
|
@@ -987,7 +988,8 @@ var composesMainContract = c.router({
|
|
|
987
988
|
200: createComposeResponseSchema,
|
|
988
989
|
201: createComposeResponseSchema,
|
|
989
990
|
400: apiErrorSchema,
|
|
990
|
-
401: apiErrorSchema
|
|
991
|
+
401: apiErrorSchema,
|
|
992
|
+
403: apiErrorSchema
|
|
991
993
|
},
|
|
992
994
|
summary: "Create or update agent compose version"
|
|
993
995
|
}
|
|
@@ -1007,6 +1009,7 @@ var composesByIdContract = c.router({
|
|
|
1007
1009
|
responses: {
|
|
1008
1010
|
200: composeResponseSchema,
|
|
1009
1011
|
401: apiErrorSchema,
|
|
1012
|
+
403: apiErrorSchema,
|
|
1010
1013
|
404: apiErrorSchema
|
|
1011
1014
|
},
|
|
1012
1015
|
summary: "Get agent compose by ID"
|
|
@@ -1027,6 +1030,7 @@ var composesByIdContract = c.router({
|
|
|
1027
1030
|
responses: {
|
|
1028
1031
|
204: c.noBody(),
|
|
1029
1032
|
401: apiErrorSchema,
|
|
1033
|
+
403: apiErrorSchema,
|
|
1030
1034
|
404: apiErrorSchema,
|
|
1031
1035
|
409: apiErrorSchema
|
|
1032
1036
|
},
|
|
@@ -1053,6 +1057,7 @@ var composesVersionsContract = c.router({
|
|
|
1053
1057
|
}),
|
|
1054
1058
|
400: apiErrorSchema,
|
|
1055
1059
|
401: apiErrorSchema,
|
|
1060
|
+
403: apiErrorSchema,
|
|
1056
1061
|
404: apiErrorSchema
|
|
1057
1062
|
},
|
|
1058
1063
|
summary: "Resolve version specifier to full version ID"
|
|
@@ -1084,7 +1089,8 @@ var composesListContract = c.router({
|
|
|
1084
1089
|
composes: z4.array(composeListItemSchema)
|
|
1085
1090
|
}),
|
|
1086
1091
|
400: apiErrorSchema,
|
|
1087
|
-
401: apiErrorSchema
|
|
1092
|
+
401: apiErrorSchema,
|
|
1093
|
+
403: apiErrorSchema
|
|
1088
1094
|
},
|
|
1089
1095
|
summary: "List all agent composes for an org"
|
|
1090
1096
|
}
|
|
@@ -1302,7 +1308,8 @@ var runsMainContract = c3.router({
|
|
|
1302
1308
|
responses: {
|
|
1303
1309
|
200: runsListResponseSchema,
|
|
1304
1310
|
400: apiErrorSchema,
|
|
1305
|
-
401: apiErrorSchema
|
|
1311
|
+
401: apiErrorSchema,
|
|
1312
|
+
403: apiErrorSchema
|
|
1306
1313
|
},
|
|
1307
1314
|
summary: "List agent runs"
|
|
1308
1315
|
},
|
|
@@ -1319,6 +1326,7 @@ var runsMainContract = c3.router({
|
|
|
1319
1326
|
201: createRunResponseSchema,
|
|
1320
1327
|
400: apiErrorSchema,
|
|
1321
1328
|
401: apiErrorSchema,
|
|
1329
|
+
403: apiErrorSchema,
|
|
1322
1330
|
404: apiErrorSchema
|
|
1323
1331
|
},
|
|
1324
1332
|
summary: "Create and execute agent run"
|
|
@@ -1367,6 +1375,7 @@ var runsCancelContract = c3.router({
|
|
|
1367
1375
|
200: cancelRunResponseSchema,
|
|
1368
1376
|
400: apiErrorSchema,
|
|
1369
1377
|
401: apiErrorSchema,
|
|
1378
|
+
403: apiErrorSchema,
|
|
1370
1379
|
404: apiErrorSchema
|
|
1371
1380
|
},
|
|
1372
1381
|
summary: "Cancel a pending or running run"
|
|
@@ -1744,6 +1753,7 @@ var storagesPrepareContract = c4.router({
|
|
|
1744
1753
|
}),
|
|
1745
1754
|
400: apiErrorSchema,
|
|
1746
1755
|
401: apiErrorSchema,
|
|
1756
|
+
403: apiErrorSchema,
|
|
1747
1757
|
404: apiErrorSchema,
|
|
1748
1758
|
413: apiErrorSchema,
|
|
1749
1759
|
500: apiErrorSchema
|
|
@@ -1775,6 +1785,7 @@ var storagesCommitContract = c4.router({
|
|
|
1775
1785
|
}),
|
|
1776
1786
|
400: apiErrorSchema,
|
|
1777
1787
|
401: apiErrorSchema,
|
|
1788
|
+
403: apiErrorSchema,
|
|
1778
1789
|
404: apiErrorSchema,
|
|
1779
1790
|
409: apiErrorSchema,
|
|
1780
1791
|
// S3 files missing
|
|
@@ -1813,6 +1824,7 @@ var storagesDownloadContract = c4.router({
|
|
|
1813
1824
|
]),
|
|
1814
1825
|
400: apiErrorSchema,
|
|
1815
1826
|
401: apiErrorSchema,
|
|
1827
|
+
403: apiErrorSchema,
|
|
1816
1828
|
404: apiErrorSchema,
|
|
1817
1829
|
500: apiErrorSchema
|
|
1818
1830
|
},
|
|
@@ -1837,6 +1849,7 @@ var storagesListContract = c4.router({
|
|
|
1837
1849
|
})
|
|
1838
1850
|
),
|
|
1839
1851
|
401: apiErrorSchema,
|
|
1852
|
+
403: apiErrorSchema,
|
|
1840
1853
|
500: apiErrorSchema
|
|
1841
1854
|
},
|
|
1842
1855
|
summary: "List user storages by type"
|
|
@@ -2249,6 +2262,7 @@ var authContract = c7.router({
|
|
|
2249
2262
|
email: z10.string()
|
|
2250
2263
|
}),
|
|
2251
2264
|
401: apiErrorSchema,
|
|
2265
|
+
403: apiErrorSchema,
|
|
2252
2266
|
404: apiErrorSchema,
|
|
2253
2267
|
500: apiErrorSchema
|
|
2254
2268
|
},
|
|
@@ -2724,7 +2738,7 @@ var modelProviderTypeSchema = z14.enum([
|
|
|
2724
2738
|
"azure-foundry",
|
|
2725
2739
|
"aws-bedrock"
|
|
2726
2740
|
]);
|
|
2727
|
-
var modelProviderFrameworkSchema = z14.enum(["claude-code"
|
|
2741
|
+
var modelProviderFrameworkSchema = z14.enum(["claude-code"]);
|
|
2728
2742
|
function hasAuthMethods(type2) {
|
|
2729
2743
|
const config = MODEL_PROVIDER_TYPES[type2];
|
|
2730
2744
|
return "authMethods" in config;
|
|
@@ -3332,6 +3346,7 @@ var schedulesMainContract = c14.router({
|
|
|
3332
3346
|
// Created
|
|
3333
3347
|
400: apiErrorSchema,
|
|
3334
3348
|
401: apiErrorSchema,
|
|
3349
|
+
403: apiErrorSchema,
|
|
3335
3350
|
404: apiErrorSchema
|
|
3336
3351
|
},
|
|
3337
3352
|
summary: "Deploy schedule (create or update)"
|
|
@@ -3346,7 +3361,8 @@ var schedulesMainContract = c14.router({
|
|
|
3346
3361
|
headers: authHeadersSchema,
|
|
3347
3362
|
responses: {
|
|
3348
3363
|
200: scheduleListResponseSchema,
|
|
3349
|
-
401: apiErrorSchema
|
|
3364
|
+
401: apiErrorSchema,
|
|
3365
|
+
403: apiErrorSchema
|
|
3350
3366
|
},
|
|
3351
3367
|
summary: "List all schedules"
|
|
3352
3368
|
}
|
|
@@ -3369,6 +3385,7 @@ var schedulesByNameContract = c14.router({
|
|
|
3369
3385
|
responses: {
|
|
3370
3386
|
200: scheduleResponseSchema,
|
|
3371
3387
|
401: apiErrorSchema,
|
|
3388
|
+
403: apiErrorSchema,
|
|
3372
3389
|
404: apiErrorSchema
|
|
3373
3390
|
},
|
|
3374
3391
|
summary: "Get schedule by name"
|
|
@@ -3390,6 +3407,7 @@ var schedulesByNameContract = c14.router({
|
|
|
3390
3407
|
responses: {
|
|
3391
3408
|
204: c14.noBody(),
|
|
3392
3409
|
401: apiErrorSchema,
|
|
3410
|
+
403: apiErrorSchema,
|
|
3393
3411
|
404: apiErrorSchema
|
|
3394
3412
|
},
|
|
3395
3413
|
summary: "Delete schedule"
|
|
@@ -3413,6 +3431,7 @@ var schedulesEnableContract = c14.router({
|
|
|
3413
3431
|
responses: {
|
|
3414
3432
|
200: scheduleResponseSchema,
|
|
3415
3433
|
401: apiErrorSchema,
|
|
3434
|
+
403: apiErrorSchema,
|
|
3416
3435
|
404: apiErrorSchema
|
|
3417
3436
|
},
|
|
3418
3437
|
summary: "Enable schedule"
|
|
@@ -3434,6 +3453,7 @@ var schedulesEnableContract = c14.router({
|
|
|
3434
3453
|
responses: {
|
|
3435
3454
|
200: scheduleResponseSchema,
|
|
3436
3455
|
401: apiErrorSchema,
|
|
3456
|
+
403: apiErrorSchema,
|
|
3437
3457
|
404: apiErrorSchema
|
|
3438
3458
|
},
|
|
3439
3459
|
summary: "Disable schedule"
|
|
@@ -3458,6 +3478,7 @@ var scheduleRunsContract = c14.router({
|
|
|
3458
3478
|
responses: {
|
|
3459
3479
|
200: scheduleRunsResponseSchema,
|
|
3460
3480
|
401: apiErrorSchema,
|
|
3481
|
+
403: apiErrorSchema,
|
|
3461
3482
|
404: apiErrorSchema
|
|
3462
3483
|
},
|
|
3463
3484
|
summary: "List recent runs for a schedule"
|
|
@@ -7103,9 +7124,6 @@ function getLegacySystemTemplateWarning(legacyFormat) {
|
|
|
7103
7124
|
if (legacyFormat === "vm0-claude-code") {
|
|
7104
7125
|
return `Warning: "${legacyFormat}" format is deprecated. Use "vm0/claude-code" instead.`;
|
|
7105
7126
|
}
|
|
7106
|
-
if (legacyFormat === "vm0-codex") {
|
|
7107
|
-
return `Warning: "${legacyFormat}" format is deprecated. Use "vm0/codex" instead.`;
|
|
7108
|
-
}
|
|
7109
7127
|
if (legacyFormat.startsWith("vm0-github-cli")) {
|
|
7110
7128
|
return `Warning: "${legacyFormat}" is deprecated. GitHub CLI is now included in the base image.`;
|
|
7111
7129
|
}
|
|
@@ -7121,7 +7139,7 @@ function getSkillStorageName(fullPath) {
|
|
|
7121
7139
|
}
|
|
7122
7140
|
|
|
7123
7141
|
// ../../packages/core/src/frameworks.ts
|
|
7124
|
-
var SUPPORTED_FRAMEWORKS = ["claude-code"
|
|
7142
|
+
var SUPPORTED_FRAMEWORKS = ["claude-code"];
|
|
7125
7143
|
function isSupportedFramework(framework) {
|
|
7126
7144
|
if (!framework) return false;
|
|
7127
7145
|
return SUPPORTED_FRAMEWORKS.includes(framework);
|
|
@@ -7142,16 +7160,14 @@ function getValidatedFramework(framework) {
|
|
|
7142
7160
|
return framework;
|
|
7143
7161
|
}
|
|
7144
7162
|
var FRAMEWORK_DISPLAY_NAMES = {
|
|
7145
|
-
"claude-code": "Claude Code"
|
|
7146
|
-
codex: "Codex"
|
|
7163
|
+
"claude-code": "Claude Code"
|
|
7147
7164
|
};
|
|
7148
7165
|
function getFrameworkDisplayName(framework) {
|
|
7149
7166
|
assertSupportedFramework(framework);
|
|
7150
7167
|
return FRAMEWORK_DISPLAY_NAMES[framework];
|
|
7151
7168
|
}
|
|
7152
7169
|
var FRAMEWORK_INSTRUCTIONS_FILENAMES = {
|
|
7153
|
-
"claude-code": "CLAUDE.md"
|
|
7154
|
-
codex: "AGENTS.md"
|
|
7170
|
+
"claude-code": "CLAUDE.md"
|
|
7155
7171
|
};
|
|
7156
7172
|
function getInstructionsFilename(framework) {
|
|
7157
7173
|
const validated = getValidatedFramework(framework);
|
|
@@ -9486,7 +9502,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
9486
9502
|
options.autoUpdate = false;
|
|
9487
9503
|
}
|
|
9488
9504
|
if (options.autoUpdate !== false) {
|
|
9489
|
-
await startSilentUpgrade("9.62.
|
|
9505
|
+
await startSilentUpgrade("9.62.2");
|
|
9490
9506
|
}
|
|
9491
9507
|
try {
|
|
9492
9508
|
let result;
|
|
@@ -9531,7 +9547,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
9531
9547
|
import { Command as Command8, Option as Option2 } from "commander";
|
|
9532
9548
|
|
|
9533
9549
|
// src/commands/run/shared.ts
|
|
9534
|
-
import
|
|
9550
|
+
import chalk9 from "chalk";
|
|
9535
9551
|
import * as fs6 from "fs";
|
|
9536
9552
|
import { config as dotenvConfig } from "dotenv";
|
|
9537
9553
|
|
|
@@ -9639,237 +9655,9 @@ var ClaudeEventParser = class {
|
|
|
9639
9655
|
}
|
|
9640
9656
|
};
|
|
9641
9657
|
|
|
9642
|
-
// src/lib/events/codex-event-parser.ts
|
|
9643
|
-
var CodexEventParser = class {
|
|
9644
|
-
/**
|
|
9645
|
-
* Parse a raw Codex CLI JSONL event into a simplified format
|
|
9646
|
-
* Returns null if the event type is unknown or malformed
|
|
9647
|
-
*/
|
|
9648
|
-
static parse(rawEvent) {
|
|
9649
|
-
if (!rawEvent || typeof rawEvent !== "object" || !("type" in rawEvent)) {
|
|
9650
|
-
return null;
|
|
9651
|
-
}
|
|
9652
|
-
const eventType = rawEvent.type;
|
|
9653
|
-
if (eventType === "thread.started") {
|
|
9654
|
-
return this.parseThreadStarted(rawEvent);
|
|
9655
|
-
}
|
|
9656
|
-
if (eventType === "turn.completed") {
|
|
9657
|
-
return this.parseTurnCompleted(rawEvent);
|
|
9658
|
-
}
|
|
9659
|
-
if (eventType === "turn.failed") {
|
|
9660
|
-
return this.parseTurnFailed(rawEvent);
|
|
9661
|
-
}
|
|
9662
|
-
if (eventType.startsWith("item.")) {
|
|
9663
|
-
return this.parseItemEvent(rawEvent);
|
|
9664
|
-
}
|
|
9665
|
-
if (eventType === "error") {
|
|
9666
|
-
return this.parseErrorEvent(rawEvent);
|
|
9667
|
-
}
|
|
9668
|
-
return null;
|
|
9669
|
-
}
|
|
9670
|
-
static parseThreadStarted(event) {
|
|
9671
|
-
return {
|
|
9672
|
-
type: "init",
|
|
9673
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9674
|
-
data: {
|
|
9675
|
-
framework: "codex",
|
|
9676
|
-
sessionId: event.thread_id,
|
|
9677
|
-
tools: []
|
|
9678
|
-
}
|
|
9679
|
-
};
|
|
9680
|
-
}
|
|
9681
|
-
static parseTurnCompleted(event) {
|
|
9682
|
-
return {
|
|
9683
|
-
type: "result",
|
|
9684
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9685
|
-
data: {
|
|
9686
|
-
success: true,
|
|
9687
|
-
result: "",
|
|
9688
|
-
durationMs: 0,
|
|
9689
|
-
numTurns: 1,
|
|
9690
|
-
cost: 0,
|
|
9691
|
-
usage: event.usage || {}
|
|
9692
|
-
}
|
|
9693
|
-
};
|
|
9694
|
-
}
|
|
9695
|
-
static parseTurnFailed(event) {
|
|
9696
|
-
return {
|
|
9697
|
-
type: "result",
|
|
9698
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9699
|
-
data: {
|
|
9700
|
-
success: false,
|
|
9701
|
-
result: event.error || "Turn failed",
|
|
9702
|
-
durationMs: 0,
|
|
9703
|
-
numTurns: 1,
|
|
9704
|
-
cost: 0,
|
|
9705
|
-
usage: {}
|
|
9706
|
-
}
|
|
9707
|
-
};
|
|
9708
|
-
}
|
|
9709
|
-
static parseItemEvent(event) {
|
|
9710
|
-
const item = event.item;
|
|
9711
|
-
if (!item) {
|
|
9712
|
-
return null;
|
|
9713
|
-
}
|
|
9714
|
-
const itemType = item.type;
|
|
9715
|
-
if (itemType === "agent_message" && item.text) {
|
|
9716
|
-
return { type: "text", timestamp: /* @__PURE__ */ new Date(), data: { text: item.text } };
|
|
9717
|
-
}
|
|
9718
|
-
if (itemType === "command_execution") {
|
|
9719
|
-
return this.parseCommandExecution(event);
|
|
9720
|
-
}
|
|
9721
|
-
if (itemType === "file_edit" || itemType === "file_write") {
|
|
9722
|
-
return this.parseFileEditOrWrite(event);
|
|
9723
|
-
}
|
|
9724
|
-
if (itemType === "file_read") {
|
|
9725
|
-
return this.parseFileRead(event);
|
|
9726
|
-
}
|
|
9727
|
-
if (itemType === "file_change") {
|
|
9728
|
-
return this.parseFileChange(item);
|
|
9729
|
-
}
|
|
9730
|
-
if (itemType === "reasoning" && item.text) {
|
|
9731
|
-
return {
|
|
9732
|
-
type: "text",
|
|
9733
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9734
|
-
data: { text: `[thinking] ${item.text}` }
|
|
9735
|
-
};
|
|
9736
|
-
}
|
|
9737
|
-
return null;
|
|
9738
|
-
}
|
|
9739
|
-
static parseCommandExecution(event) {
|
|
9740
|
-
const item = event.item;
|
|
9741
|
-
if (event.type === "item.started" && item.command) {
|
|
9742
|
-
return {
|
|
9743
|
-
type: "tool_use",
|
|
9744
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9745
|
-
data: {
|
|
9746
|
-
tool: "Bash",
|
|
9747
|
-
toolUseId: item.id,
|
|
9748
|
-
input: { command: item.command }
|
|
9749
|
-
}
|
|
9750
|
-
};
|
|
9751
|
-
}
|
|
9752
|
-
if (event.type === "item.completed") {
|
|
9753
|
-
const output = item.aggregated_output ?? item.output ?? "";
|
|
9754
|
-
return {
|
|
9755
|
-
type: "tool_result",
|
|
9756
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9757
|
-
data: {
|
|
9758
|
-
toolUseId: item.id,
|
|
9759
|
-
result: output,
|
|
9760
|
-
isError: item.exit_code !== 0
|
|
9761
|
-
}
|
|
9762
|
-
};
|
|
9763
|
-
}
|
|
9764
|
-
return null;
|
|
9765
|
-
}
|
|
9766
|
-
static parseFileEditOrWrite(event) {
|
|
9767
|
-
const item = event.item;
|
|
9768
|
-
if (event.type === "item.started" && item.path) {
|
|
9769
|
-
return {
|
|
9770
|
-
type: "tool_use",
|
|
9771
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9772
|
-
data: {
|
|
9773
|
-
tool: item.type === "file_edit" ? "Edit" : "Write",
|
|
9774
|
-
toolUseId: item.id,
|
|
9775
|
-
input: { file_path: item.path }
|
|
9776
|
-
}
|
|
9777
|
-
};
|
|
9778
|
-
}
|
|
9779
|
-
if (event.type === "item.completed") {
|
|
9780
|
-
return {
|
|
9781
|
-
type: "tool_result",
|
|
9782
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9783
|
-
data: {
|
|
9784
|
-
toolUseId: item.id,
|
|
9785
|
-
result: item.diff || "File operation completed",
|
|
9786
|
-
isError: false
|
|
9787
|
-
}
|
|
9788
|
-
};
|
|
9789
|
-
}
|
|
9790
|
-
return null;
|
|
9791
|
-
}
|
|
9792
|
-
static parseFileRead(event) {
|
|
9793
|
-
const item = event.item;
|
|
9794
|
-
if (event.type === "item.started" && item.path) {
|
|
9795
|
-
return {
|
|
9796
|
-
type: "tool_use",
|
|
9797
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9798
|
-
data: {
|
|
9799
|
-
tool: "Read",
|
|
9800
|
-
toolUseId: item.id,
|
|
9801
|
-
input: { file_path: item.path }
|
|
9802
|
-
}
|
|
9803
|
-
};
|
|
9804
|
-
}
|
|
9805
|
-
if (event.type === "item.completed") {
|
|
9806
|
-
return {
|
|
9807
|
-
type: "tool_result",
|
|
9808
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9809
|
-
data: {
|
|
9810
|
-
toolUseId: item.id,
|
|
9811
|
-
result: "File read completed",
|
|
9812
|
-
isError: false
|
|
9813
|
-
}
|
|
9814
|
-
};
|
|
9815
|
-
}
|
|
9816
|
-
return null;
|
|
9817
|
-
}
|
|
9818
|
-
static parseFileChange(item) {
|
|
9819
|
-
if (!item.changes || item.changes.length === 0) {
|
|
9820
|
-
return null;
|
|
9821
|
-
}
|
|
9822
|
-
const changes = item.changes.map((c24) => {
|
|
9823
|
-
const action = c24.kind === "add" ? "Created" : c24.kind === "modify" ? "Modified" : "Deleted";
|
|
9824
|
-
return `${action}: ${c24.path}`;
|
|
9825
|
-
}).join("\n");
|
|
9826
|
-
return {
|
|
9827
|
-
type: "text",
|
|
9828
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9829
|
-
data: { text: `[files]
|
|
9830
|
-
${changes}` }
|
|
9831
|
-
};
|
|
9832
|
-
}
|
|
9833
|
-
static parseErrorEvent(event) {
|
|
9834
|
-
return {
|
|
9835
|
-
type: "result",
|
|
9836
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
9837
|
-
data: {
|
|
9838
|
-
success: false,
|
|
9839
|
-
result: event.message || event.error || "Unknown error",
|
|
9840
|
-
durationMs: 0,
|
|
9841
|
-
numTurns: 0,
|
|
9842
|
-
cost: 0,
|
|
9843
|
-
usage: {}
|
|
9844
|
-
}
|
|
9845
|
-
};
|
|
9846
|
-
}
|
|
9847
|
-
};
|
|
9848
|
-
|
|
9849
9658
|
// src/lib/events/event-parser-factory.ts
|
|
9850
|
-
function
|
|
9851
|
-
|
|
9852
|
-
return null;
|
|
9853
|
-
}
|
|
9854
|
-
const eventType = rawEvent.type;
|
|
9855
|
-
if (eventType === "thread.started" || eventType === "turn.started" || eventType === "turn.completed" || eventType === "turn.failed" || eventType?.startsWith("item.")) {
|
|
9856
|
-
return "codex";
|
|
9857
|
-
}
|
|
9858
|
-
if (eventType === "system" || eventType === "assistant" || eventType === "user" || eventType === "result") {
|
|
9859
|
-
return "claude-code";
|
|
9860
|
-
}
|
|
9861
|
-
return null;
|
|
9862
|
-
}
|
|
9863
|
-
function getEventParser(framework) {
|
|
9864
|
-
if (framework === "codex") {
|
|
9865
|
-
return CodexEventParser;
|
|
9866
|
-
}
|
|
9867
|
-
return ClaudeEventParser;
|
|
9868
|
-
}
|
|
9869
|
-
function parseEvent(rawEvent, framework) {
|
|
9870
|
-
const effectiveFramework = framework ? getValidatedFramework(framework) : detectFrameworkFromEvent(rawEvent) || "claude-code";
|
|
9871
|
-
const Parser = getEventParser(effectiveFramework);
|
|
9872
|
-
return Parser.parse(rawEvent);
|
|
9659
|
+
function parseEvent(rawEvent) {
|
|
9660
|
+
return ClaudeEventParser.parse(rawEvent);
|
|
9873
9661
|
}
|
|
9874
9662
|
|
|
9875
9663
|
// src/lib/events/event-renderer.ts
|
|
@@ -10339,123 +10127,6 @@ var EventRenderer = class _EventRenderer {
|
|
|
10339
10127
|
}
|
|
10340
10128
|
};
|
|
10341
10129
|
|
|
10342
|
-
// src/lib/events/codex-event-renderer.ts
|
|
10343
|
-
import chalk9 from "chalk";
|
|
10344
|
-
var CodexEventRenderer = class {
|
|
10345
|
-
/**
|
|
10346
|
-
* Check if an event is a Codex event
|
|
10347
|
-
*/
|
|
10348
|
-
static isCodexEvent(event) {
|
|
10349
|
-
const type2 = event.type;
|
|
10350
|
-
return type2 === "thread.started" || type2 === "turn.started" || type2 === "turn.completed" || type2 === "turn.failed" || type2?.startsWith("item.") || type2 === "error";
|
|
10351
|
-
}
|
|
10352
|
-
/**
|
|
10353
|
-
* Render a raw Codex event
|
|
10354
|
-
*/
|
|
10355
|
-
static render(rawEvent) {
|
|
10356
|
-
const event = rawEvent;
|
|
10357
|
-
const type2 = event.type;
|
|
10358
|
-
switch (type2) {
|
|
10359
|
-
case "thread.started":
|
|
10360
|
-
this.renderThreadStarted(event);
|
|
10361
|
-
break;
|
|
10362
|
-
case "turn.started":
|
|
10363
|
-
break;
|
|
10364
|
-
case "turn.completed":
|
|
10365
|
-
this.renderTurnCompleted(event);
|
|
10366
|
-
break;
|
|
10367
|
-
case "turn.failed":
|
|
10368
|
-
this.renderTurnFailed(event);
|
|
10369
|
-
break;
|
|
10370
|
-
case "item.started":
|
|
10371
|
-
case "item.updated":
|
|
10372
|
-
case "item.completed":
|
|
10373
|
-
this.renderItem(event);
|
|
10374
|
-
break;
|
|
10375
|
-
case "error":
|
|
10376
|
-
this.renderError(event);
|
|
10377
|
-
break;
|
|
10378
|
-
}
|
|
10379
|
-
}
|
|
10380
|
-
static renderThreadStarted(event) {
|
|
10381
|
-
console.log(`[thread.started] ${event.thread_id}`);
|
|
10382
|
-
}
|
|
10383
|
-
static renderTurnCompleted(event) {
|
|
10384
|
-
if (event.usage) {
|
|
10385
|
-
const input = event.usage.input_tokens || 0;
|
|
10386
|
-
const output = event.usage.output_tokens || 0;
|
|
10387
|
-
const cached = event.usage.cached_input_tokens || 0;
|
|
10388
|
-
const cachedStr = cached ? ` (${cached} cached)` : "";
|
|
10389
|
-
console.log(
|
|
10390
|
-
"[turn.completed]" + chalk9.dim(` ${input} in / ${output} out${cachedStr}`)
|
|
10391
|
-
);
|
|
10392
|
-
}
|
|
10393
|
-
}
|
|
10394
|
-
static renderTurnFailed(event) {
|
|
10395
|
-
console.log(
|
|
10396
|
-
chalk9.red("[turn.failed]") + (event.error ? ` ${event.error}` : "")
|
|
10397
|
-
);
|
|
10398
|
-
}
|
|
10399
|
-
static renderItem(event) {
|
|
10400
|
-
const item = event.item;
|
|
10401
|
-
if (!item) return;
|
|
10402
|
-
const itemType = item.type;
|
|
10403
|
-
const eventType = event.type;
|
|
10404
|
-
if (itemType === "reasoning" && item.text) {
|
|
10405
|
-
console.log(`[reasoning] ${item.text}`);
|
|
10406
|
-
} else if (itemType === "agent_message" && item.text) {
|
|
10407
|
-
console.log(`[message] ${item.text}`);
|
|
10408
|
-
} else if (itemType === "command_execution") {
|
|
10409
|
-
this.renderCommandExecution(item, eventType);
|
|
10410
|
-
} else if (itemType === "file_change") {
|
|
10411
|
-
this.renderFileChange(item);
|
|
10412
|
-
} else if (itemType === "file_edit" || itemType === "file_write" || itemType === "file_read") {
|
|
10413
|
-
this.renderFileOperation(item, eventType);
|
|
10414
|
-
}
|
|
10415
|
-
}
|
|
10416
|
-
static renderCommandExecution(item, eventType) {
|
|
10417
|
-
if (eventType === "item.started" && item.command) {
|
|
10418
|
-
console.log(`[exec] ${item.command}`);
|
|
10419
|
-
} else if (eventType === "item.completed") {
|
|
10420
|
-
const output = item.aggregated_output || "";
|
|
10421
|
-
const exitCode = item.exit_code ?? 0;
|
|
10422
|
-
if (output) {
|
|
10423
|
-
const lines = output.split("\n").filter((l) => l.trim());
|
|
10424
|
-
const preview = lines.slice(0, 3).join("\n ");
|
|
10425
|
-
const more = lines.length > 3 ? chalk9.dim(` ... (${lines.length - 3} more lines)`) : "";
|
|
10426
|
-
console.log(
|
|
10427
|
-
"[output]" + (exitCode !== 0 ? chalk9.red(` exit=${exitCode}`) : "")
|
|
10428
|
-
);
|
|
10429
|
-
if (preview) {
|
|
10430
|
-
console.log(" " + preview + more);
|
|
10431
|
-
}
|
|
10432
|
-
} else if (exitCode !== 0) {
|
|
10433
|
-
console.log(chalk9.red("[output]") + chalk9.red(` exit=${exitCode}`));
|
|
10434
|
-
}
|
|
10435
|
-
}
|
|
10436
|
-
}
|
|
10437
|
-
static renderFileChange(item) {
|
|
10438
|
-
if (item.changes && item.changes.length > 0) {
|
|
10439
|
-
const summary = item.changes.map((c24) => {
|
|
10440
|
-
const icon = c24.kind === "add" ? "+" : c24.kind === "delete" ? "-" : "~";
|
|
10441
|
-
return `${icon}${c24.path}`;
|
|
10442
|
-
}).join(", ");
|
|
10443
|
-
console.log(chalk9.green("[files]") + ` ${summary}`);
|
|
10444
|
-
}
|
|
10445
|
-
}
|
|
10446
|
-
static renderFileOperation(item, eventType) {
|
|
10447
|
-
const action = item.type.replace("file_", "");
|
|
10448
|
-
if (eventType === "item.started" && item.path) {
|
|
10449
|
-
console.log(`[${action}] ${item.path}`);
|
|
10450
|
-
}
|
|
10451
|
-
}
|
|
10452
|
-
static renderError(event) {
|
|
10453
|
-
console.log(
|
|
10454
|
-
chalk9.red("[error]") + ` ${event.message || event.error || "Unknown error"}`
|
|
10455
|
-
);
|
|
10456
|
-
}
|
|
10457
|
-
};
|
|
10458
|
-
|
|
10459
10130
|
// src/commands/run/shared.ts
|
|
10460
10131
|
function collectKeyValue(value, previous) {
|
|
10461
10132
|
const [key, ...valueParts] = value.split("=");
|
|
@@ -10538,10 +10209,10 @@ function parseIdentifier(identifier) {
|
|
|
10538
10209
|
}
|
|
10539
10210
|
function renderRunCreated(response) {
|
|
10540
10211
|
if (response.status === "queued") {
|
|
10541
|
-
console.log(
|
|
10542
|
-
console.log(` Run ID: ${
|
|
10212
|
+
console.log(chalk9.yellow("\u26A0 Run queued \u2014 concurrency limit reached"));
|
|
10213
|
+
console.log(` Run ID: ${chalk9.dim(response.runId)}`);
|
|
10543
10214
|
console.log(
|
|
10544
|
-
|
|
10215
|
+
chalk9.dim(" Will start automatically when a slot is available")
|
|
10545
10216
|
);
|
|
10546
10217
|
console.log();
|
|
10547
10218
|
} else {
|
|
@@ -10563,13 +10234,9 @@ async function pollEvents(runId, options) {
|
|
|
10563
10234
|
});
|
|
10564
10235
|
for (const event of response.events) {
|
|
10565
10236
|
const eventData = event.eventData;
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
const parsed = parseEvent(eventData);
|
|
10570
|
-
if (parsed) {
|
|
10571
|
-
renderer.render(parsed);
|
|
10572
|
-
}
|
|
10237
|
+
const parsed = parseEvent(eventData);
|
|
10238
|
+
if (parsed) {
|
|
10239
|
+
renderer.render(parsed);
|
|
10573
10240
|
}
|
|
10574
10241
|
}
|
|
10575
10242
|
nextSequence = response.nextSequence;
|
|
@@ -10589,9 +10256,9 @@ async function pollEvents(runId, options) {
|
|
|
10589
10256
|
result = { succeeded: false, runId };
|
|
10590
10257
|
} else if (runStatus === "timeout") {
|
|
10591
10258
|
complete = true;
|
|
10592
|
-
console.error(
|
|
10259
|
+
console.error(chalk9.red("\n\u2717 Run timed out"));
|
|
10593
10260
|
console.error(
|
|
10594
|
-
|
|
10261
|
+
chalk9.dim(` (use "vm0 logs ${runId} --system" to view system logs)`)
|
|
10595
10262
|
);
|
|
10596
10263
|
result = { succeeded: false, runId };
|
|
10597
10264
|
}
|
|
@@ -10605,11 +10272,11 @@ function showNextSteps(result) {
|
|
|
10605
10272
|
const { runId, sessionId, checkpointId } = result;
|
|
10606
10273
|
console.log();
|
|
10607
10274
|
console.log(" View agent logs:");
|
|
10608
|
-
console.log(
|
|
10275
|
+
console.log(chalk9.cyan(` vm0 logs ${runId}`));
|
|
10609
10276
|
if (sessionId) {
|
|
10610
10277
|
console.log(" Continue with session (latest conversation and artifact):");
|
|
10611
10278
|
console.log(
|
|
10612
|
-
|
|
10279
|
+
chalk9.cyan(` vm0 run continue ${sessionId} "your next prompt"`)
|
|
10613
10280
|
);
|
|
10614
10281
|
}
|
|
10615
10282
|
if (checkpointId) {
|
|
@@ -10617,7 +10284,7 @@ function showNextSteps(result) {
|
|
|
10617
10284
|
" Resume from checkpoint (snapshotted conversation and artifact):"
|
|
10618
10285
|
);
|
|
10619
10286
|
console.log(
|
|
10620
|
-
|
|
10287
|
+
chalk9.cyan(` vm0 run resume ${checkpointId} "your next prompt"`)
|
|
10621
10288
|
);
|
|
10622
10289
|
}
|
|
10623
10290
|
}
|
|
@@ -10657,7 +10324,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
10657
10324
|
withErrorHandler(
|
|
10658
10325
|
async (identifier, prompt, options) => {
|
|
10659
10326
|
if (options.autoUpdate !== false) {
|
|
10660
|
-
await startSilentUpgrade("9.62.
|
|
10327
|
+
await startSilentUpgrade("9.62.2");
|
|
10661
10328
|
}
|
|
10662
10329
|
const { org, name, version } = parseIdentifier(identifier);
|
|
10663
10330
|
let composeId;
|
|
@@ -10862,7 +10529,7 @@ var continueCommand = new Command10().name("continue").description(
|
|
|
10862
10529
|
|
|
10863
10530
|
// src/commands/run/list.ts
|
|
10864
10531
|
import { Command as Command11 } from "commander";
|
|
10865
|
-
import
|
|
10532
|
+
import chalk10 from "chalk";
|
|
10866
10533
|
|
|
10867
10534
|
// src/lib/utils/time-parser.ts
|
|
10868
10535
|
function parseTime(timeStr) {
|
|
@@ -10915,16 +10582,16 @@ function formatRunStatus(status, width) {
|
|
|
10915
10582
|
const paddedStatus = width ? status.padEnd(width) : status;
|
|
10916
10583
|
switch (status) {
|
|
10917
10584
|
case "queued":
|
|
10918
|
-
return
|
|
10585
|
+
return chalk10.blue(paddedStatus);
|
|
10919
10586
|
case "running":
|
|
10920
|
-
return
|
|
10587
|
+
return chalk10.green(paddedStatus);
|
|
10921
10588
|
case "pending":
|
|
10922
|
-
return
|
|
10589
|
+
return chalk10.yellow(paddedStatus);
|
|
10923
10590
|
case "completed":
|
|
10924
|
-
return
|
|
10591
|
+
return chalk10.dim(paddedStatus);
|
|
10925
10592
|
case "failed":
|
|
10926
10593
|
case "timeout":
|
|
10927
|
-
return
|
|
10594
|
+
return chalk10.red(paddedStatus);
|
|
10928
10595
|
default:
|
|
10929
10596
|
return paddedStatus;
|
|
10930
10597
|
}
|
|
@@ -10975,7 +10642,7 @@ function displayRuns(runs) {
|
|
|
10975
10642
|
"STATUS".padEnd(statusWidth),
|
|
10976
10643
|
"CREATED"
|
|
10977
10644
|
].join(" ");
|
|
10978
|
-
console.log(
|
|
10645
|
+
console.log(chalk10.dim(header));
|
|
10979
10646
|
for (const run of runs) {
|
|
10980
10647
|
const row = [
|
|
10981
10648
|
run.id.padEnd(UUID_LENGTH),
|
|
@@ -10988,10 +10655,10 @@ function displayRuns(runs) {
|
|
|
10988
10655
|
}
|
|
10989
10656
|
function displayEmptyState(hasFilters) {
|
|
10990
10657
|
if (hasFilters) {
|
|
10991
|
-
console.log(
|
|
10658
|
+
console.log(chalk10.dim("No runs found matching filters"));
|
|
10992
10659
|
} else {
|
|
10993
|
-
console.log(
|
|
10994
|
-
console.log(
|
|
10660
|
+
console.log(chalk10.dim("No active runs"));
|
|
10661
|
+
console.log(chalk10.dim(' Run: vm0 run <agent> "<prompt>"'));
|
|
10995
10662
|
}
|
|
10996
10663
|
}
|
|
10997
10664
|
var listCommand = new Command11().name("list").alias("ls").description("List runs").option(
|
|
@@ -11028,17 +10695,17 @@ var listCommand = new Command11().name("list").alias("ls").description("List run
|
|
|
11028
10695
|
|
|
11029
10696
|
// src/commands/run/kill.ts
|
|
11030
10697
|
import { Command as Command12 } from "commander";
|
|
11031
|
-
import
|
|
10698
|
+
import chalk11 from "chalk";
|
|
11032
10699
|
var killCommand = new Command12().name("kill").description("Kill (cancel) a pending or running run").argument("<run-id>", "Run ID to kill").action(
|
|
11033
10700
|
withErrorHandler(async (runId) => {
|
|
11034
10701
|
await cancelRun(runId);
|
|
11035
|
-
console.log(
|
|
10702
|
+
console.log(chalk11.green(`\u2713 Run ${runId} cancelled`));
|
|
11036
10703
|
})
|
|
11037
10704
|
);
|
|
11038
10705
|
|
|
11039
10706
|
// src/commands/run/queue.ts
|
|
11040
10707
|
import { Command as Command13 } from "commander";
|
|
11041
|
-
import
|
|
10708
|
+
import chalk12 from "chalk";
|
|
11042
10709
|
var queueCommand = new Command13().name("queue").description("Show org run queue status").action(
|
|
11043
10710
|
withErrorHandler(async () => {
|
|
11044
10711
|
const data = await getRunQueue();
|
|
@@ -11046,7 +10713,7 @@ var queueCommand = new Command13().name("queue").description("Show org run queue
|
|
|
11046
10713
|
const limitDisplay = concurrency.limit === 0 ? "unlimited" : `${concurrency.active}/${concurrency.limit} slots used`;
|
|
11047
10714
|
console.log(`Concurrency: ${limitDisplay} (${concurrency.tier} tier)`);
|
|
11048
10715
|
if (queue.length === 0) {
|
|
11049
|
-
console.log(
|
|
10716
|
+
console.log(chalk12.dim("Queue: empty \u2014 all slots available"));
|
|
11050
10717
|
return;
|
|
11051
10718
|
}
|
|
11052
10719
|
console.log(
|
|
@@ -11062,9 +10729,9 @@ var queueCommand = new Command13().name("queue").description("Show org run queue
|
|
|
11062
10729
|
"USER".padEnd(emailWidth),
|
|
11063
10730
|
"CREATED"
|
|
11064
10731
|
].join(" ");
|
|
11065
|
-
console.log(
|
|
10732
|
+
console.log(chalk12.dim(header));
|
|
11066
10733
|
for (const entry of queue) {
|
|
11067
|
-
const marker = entry.isOwner ?
|
|
10734
|
+
const marker = entry.isOwner ? chalk12.cyan(" \u2190 you") : "";
|
|
11068
10735
|
const row = [
|
|
11069
10736
|
String(entry.position).padEnd(posWidth),
|
|
11070
10737
|
entry.agentName.padEnd(agentWidth),
|
|
@@ -11089,7 +10756,7 @@ import { Command as Command20 } from "commander";
|
|
|
11089
10756
|
|
|
11090
10757
|
// src/commands/volume/init.ts
|
|
11091
10758
|
import { Command as Command14 } from "commander";
|
|
11092
|
-
import
|
|
10759
|
+
import chalk13 from "chalk";
|
|
11093
10760
|
import path7 from "path";
|
|
11094
10761
|
|
|
11095
10762
|
// src/lib/storage/storage-utils.ts
|
|
@@ -11147,10 +10814,10 @@ var initCommand = new Command14().name("init").description("Initialize a volume
|
|
|
11147
10814
|
const existingConfig = await readStorageConfig(cwd);
|
|
11148
10815
|
if (existingConfig) {
|
|
11149
10816
|
console.log(
|
|
11150
|
-
|
|
10817
|
+
chalk13.yellow(`Volume already initialized: ${existingConfig.name}`)
|
|
11151
10818
|
);
|
|
11152
10819
|
console.log(
|
|
11153
|
-
|
|
10820
|
+
chalk13.dim(`Config file: ${path7.join(cwd, ".vm0", "storage.yaml")}`)
|
|
11154
10821
|
);
|
|
11155
10822
|
return;
|
|
11156
10823
|
}
|
|
@@ -11174,7 +10841,7 @@ var initCommand = new Command14().name("init").description("Initialize a volume
|
|
|
11174
10841
|
}
|
|
11175
10842
|
);
|
|
11176
10843
|
if (name === void 0) {
|
|
11177
|
-
console.log(
|
|
10844
|
+
console.log(chalk13.dim("Cancelled"));
|
|
11178
10845
|
return;
|
|
11179
10846
|
}
|
|
11180
10847
|
volumeName = name;
|
|
@@ -11187,9 +10854,9 @@ var initCommand = new Command14().name("init").description("Initialize a volume
|
|
|
11187
10854
|
});
|
|
11188
10855
|
}
|
|
11189
10856
|
await writeStorageConfig(volumeName, cwd);
|
|
11190
|
-
console.log(
|
|
10857
|
+
console.log(chalk13.green(`\u2713 Initialized volume: ${volumeName}`));
|
|
11191
10858
|
console.log(
|
|
11192
|
-
|
|
10859
|
+
chalk13.dim(
|
|
11193
10860
|
` Config saved to ${path7.join(cwd, ".vm0", "storage.yaml")}`
|
|
11194
10861
|
)
|
|
11195
10862
|
);
|
|
@@ -11198,7 +10865,7 @@ var initCommand = new Command14().name("init").description("Initialize a volume
|
|
|
11198
10865
|
|
|
11199
10866
|
// src/commands/volume/push.ts
|
|
11200
10867
|
import { Command as Command15 } from "commander";
|
|
11201
|
-
import
|
|
10868
|
+
import chalk14 from "chalk";
|
|
11202
10869
|
var pushCommand = new Command15().name("push").description("Push local files to cloud volume").option(
|
|
11203
10870
|
"-f, --force",
|
|
11204
10871
|
"Force upload even if content unchanged (recreate archive)"
|
|
@@ -11214,41 +10881,41 @@ var pushCommand = new Command15().name("push").description("Push local files to
|
|
|
11214
10881
|
console.log(`Pushing volume: ${config.name}`);
|
|
11215
10882
|
const result = await directUpload(config.name, "volume", cwd, {
|
|
11216
10883
|
onProgress: (message) => {
|
|
11217
|
-
console.log(
|
|
10884
|
+
console.log(chalk14.dim(message));
|
|
11218
10885
|
},
|
|
11219
10886
|
force: options.force
|
|
11220
10887
|
});
|
|
11221
10888
|
const shortVersion = result.versionId.slice(0, 8);
|
|
11222
10889
|
if (result.empty) {
|
|
11223
|
-
console.log(
|
|
10890
|
+
console.log(chalk14.dim("No files found (empty volume)"));
|
|
11224
10891
|
} else if (result.deduplicated) {
|
|
11225
|
-
console.log(
|
|
10892
|
+
console.log(chalk14.green("\u2713 Content unchanged (deduplicated)"));
|
|
11226
10893
|
} else {
|
|
11227
|
-
console.log(
|
|
10894
|
+
console.log(chalk14.green("\u2713 Upload complete"));
|
|
11228
10895
|
}
|
|
11229
|
-
console.log(
|
|
11230
|
-
console.log(
|
|
11231
|
-
console.log(
|
|
10896
|
+
console.log(chalk14.dim(` Version: ${shortVersion}`));
|
|
10897
|
+
console.log(chalk14.dim(` Files: ${result.fileCount.toLocaleString()}`));
|
|
10898
|
+
console.log(chalk14.dim(` Size: ${formatBytes(result.size)}`));
|
|
11232
10899
|
})
|
|
11233
10900
|
);
|
|
11234
10901
|
|
|
11235
10902
|
// src/commands/volume/pull.ts
|
|
11236
10903
|
import { Command as Command16 } from "commander";
|
|
11237
|
-
import
|
|
10904
|
+
import chalk16 from "chalk";
|
|
11238
10905
|
import path8 from "path";
|
|
11239
10906
|
import * as fs7 from "fs";
|
|
11240
10907
|
import * as os5 from "os";
|
|
11241
10908
|
import * as tar3 from "tar";
|
|
11242
10909
|
|
|
11243
10910
|
// src/lib/storage/pull-utils.ts
|
|
11244
|
-
import
|
|
10911
|
+
import chalk15 from "chalk";
|
|
11245
10912
|
async function handleEmptyStorageResponse(cwd) {
|
|
11246
|
-
console.log(
|
|
10913
|
+
console.log(chalk15.dim("Syncing local files..."));
|
|
11247
10914
|
const removedCount = await removeExtraFiles(cwd, /* @__PURE__ */ new Set());
|
|
11248
10915
|
if (removedCount > 0) {
|
|
11249
|
-
console.log(
|
|
10916
|
+
console.log(chalk15.green(`\u2713 Removed ${removedCount} files not in remote`));
|
|
11250
10917
|
}
|
|
11251
|
-
console.log(
|
|
10918
|
+
console.log(chalk15.green("\u2713 Synced (0 files)"));
|
|
11252
10919
|
return { removedCount };
|
|
11253
10920
|
}
|
|
11254
10921
|
|
|
@@ -11267,7 +10934,7 @@ var pullCommand = new Command16().name("pull").description("Pull cloud files to
|
|
|
11267
10934
|
} else {
|
|
11268
10935
|
console.log(`Pulling volume: ${config.name}`);
|
|
11269
10936
|
}
|
|
11270
|
-
console.log(
|
|
10937
|
+
console.log(chalk16.dim("Getting download URL..."));
|
|
11271
10938
|
const downloadInfo = await getStorageDownload({
|
|
11272
10939
|
name: config.name,
|
|
11273
10940
|
type: "volume",
|
|
@@ -11281,18 +10948,18 @@ var pullCommand = new Command16().name("pull").description("Pull cloud files to
|
|
|
11281
10948
|
if (!downloadUrl) {
|
|
11282
10949
|
throw new Error("No download URL returned");
|
|
11283
10950
|
}
|
|
11284
|
-
console.log(
|
|
10951
|
+
console.log(chalk16.dim("Downloading from S3..."));
|
|
11285
10952
|
const s3Response = await fetch(downloadUrl);
|
|
11286
10953
|
if (!s3Response.ok) {
|
|
11287
10954
|
throw new Error(`S3 download failed: ${s3Response.status}`);
|
|
11288
10955
|
}
|
|
11289
10956
|
const arrayBuffer = await s3Response.arrayBuffer();
|
|
11290
10957
|
const tarBuffer = Buffer.from(arrayBuffer);
|
|
11291
|
-
console.log(
|
|
10958
|
+
console.log(chalk16.green(`\u2713 Downloaded ${formatBytes(tarBuffer.length)}`));
|
|
11292
10959
|
const tmpDir = fs7.mkdtempSync(path8.join(os5.tmpdir(), "vm0-"));
|
|
11293
10960
|
const tarPath = path8.join(tmpDir, "volume.tar.gz");
|
|
11294
10961
|
await fs7.promises.writeFile(tarPath, tarBuffer);
|
|
11295
|
-
console.log(
|
|
10962
|
+
console.log(chalk16.dim("Syncing local files..."));
|
|
11296
10963
|
const remoteFiles = await listTarFiles(tarPath);
|
|
11297
10964
|
const remoteFilesSet = new Set(
|
|
11298
10965
|
remoteFiles.map((f) => f.replace(/\\/g, "/"))
|
|
@@ -11300,10 +10967,10 @@ var pullCommand = new Command16().name("pull").description("Pull cloud files to
|
|
|
11300
10967
|
const removedCount = await removeExtraFiles(cwd, remoteFilesSet);
|
|
11301
10968
|
if (removedCount > 0) {
|
|
11302
10969
|
console.log(
|
|
11303
|
-
|
|
10970
|
+
chalk16.green(`\u2713 Removed ${removedCount} files not in remote`)
|
|
11304
10971
|
);
|
|
11305
10972
|
}
|
|
11306
|
-
console.log(
|
|
10973
|
+
console.log(chalk16.dim("Extracting files..."));
|
|
11307
10974
|
await tar3.extract({
|
|
11308
10975
|
file: tarPath,
|
|
11309
10976
|
cwd,
|
|
@@ -11311,13 +10978,13 @@ var pullCommand = new Command16().name("pull").description("Pull cloud files to
|
|
|
11311
10978
|
});
|
|
11312
10979
|
await fs7.promises.unlink(tarPath);
|
|
11313
10980
|
await fs7.promises.rmdir(tmpDir);
|
|
11314
|
-
console.log(
|
|
10981
|
+
console.log(chalk16.green(`\u2713 Extracted ${remoteFiles.length} files`));
|
|
11315
10982
|
})
|
|
11316
10983
|
);
|
|
11317
10984
|
|
|
11318
10985
|
// src/commands/volume/status.ts
|
|
11319
10986
|
import { Command as Command17 } from "commander";
|
|
11320
|
-
import
|
|
10987
|
+
import chalk17 from "chalk";
|
|
11321
10988
|
var statusCommand2 = new Command17().name("status").description("Show status of cloud volume").action(
|
|
11322
10989
|
withErrorHandler(async () => {
|
|
11323
10990
|
const cwd = process.cwd();
|
|
@@ -11341,13 +11008,13 @@ var statusCommand2 = new Command17().name("status").description("Show status of
|
|
|
11341
11008
|
});
|
|
11342
11009
|
const shortVersion = info.versionId.slice(0, 8);
|
|
11343
11010
|
if ("empty" in info) {
|
|
11344
|
-
console.log(
|
|
11345
|
-
console.log(
|
|
11011
|
+
console.log(chalk17.green("\u2713 Found (empty)"));
|
|
11012
|
+
console.log(chalk17.dim(` Version: ${shortVersion}`));
|
|
11346
11013
|
} else {
|
|
11347
|
-
console.log(
|
|
11348
|
-
console.log(
|
|
11349
|
-
console.log(
|
|
11350
|
-
console.log(
|
|
11014
|
+
console.log(chalk17.green("\u2713 Found"));
|
|
11015
|
+
console.log(chalk17.dim(` Version: ${shortVersion}`));
|
|
11016
|
+
console.log(chalk17.dim(` Files: ${info.fileCount.toLocaleString()}`));
|
|
11017
|
+
console.log(chalk17.dim(` Size: ${formatBytes(info.size)}`));
|
|
11351
11018
|
}
|
|
11352
11019
|
} catch (error) {
|
|
11353
11020
|
if (error instanceof ApiRequestError && error.status === 404) {
|
|
@@ -11362,14 +11029,14 @@ var statusCommand2 = new Command17().name("status").description("Show status of
|
|
|
11362
11029
|
|
|
11363
11030
|
// src/commands/volume/list.ts
|
|
11364
11031
|
import { Command as Command18 } from "commander";
|
|
11365
|
-
import
|
|
11032
|
+
import chalk18 from "chalk";
|
|
11366
11033
|
var listCommand2 = new Command18().name("list").alias("ls").description("List all remote volumes").action(
|
|
11367
11034
|
withErrorHandler(async () => {
|
|
11368
11035
|
const items = await listStorages({ type: "volume" });
|
|
11369
11036
|
if (items.length === 0) {
|
|
11370
|
-
console.log(
|
|
11037
|
+
console.log(chalk18.dim("No volumes found"));
|
|
11371
11038
|
console.log(
|
|
11372
|
-
|
|
11039
|
+
chalk18.dim(" Create one with: vm0 volume init && vm0 volume push")
|
|
11373
11040
|
);
|
|
11374
11041
|
return;
|
|
11375
11042
|
}
|
|
@@ -11388,7 +11055,7 @@ var listCommand2 = new Command18().name("list").alias("ls").description("List al
|
|
|
11388
11055
|
"FILES".padStart(filesWidth),
|
|
11389
11056
|
"UPDATED"
|
|
11390
11057
|
].join(" ");
|
|
11391
|
-
console.log(
|
|
11058
|
+
console.log(chalk18.dim(header));
|
|
11392
11059
|
for (const item of items) {
|
|
11393
11060
|
const row = [
|
|
11394
11061
|
item.name.padEnd(nameWidth),
|
|
@@ -11403,10 +11070,10 @@ var listCommand2 = new Command18().name("list").alias("ls").description("List al
|
|
|
11403
11070
|
|
|
11404
11071
|
// src/commands/volume/clone.ts
|
|
11405
11072
|
import { Command as Command19 } from "commander";
|
|
11406
|
-
import
|
|
11073
|
+
import chalk20 from "chalk";
|
|
11407
11074
|
|
|
11408
11075
|
// src/lib/storage/clone-utils.ts
|
|
11409
|
-
import
|
|
11076
|
+
import chalk19 from "chalk";
|
|
11410
11077
|
import path9 from "path";
|
|
11411
11078
|
import * as fs8 from "fs";
|
|
11412
11079
|
import * as os6 from "os";
|
|
@@ -11417,18 +11084,18 @@ async function cloneStorage(name, type2, destination, options = {}) {
|
|
|
11417
11084
|
if (dirStatus.exists && !dirStatus.empty) {
|
|
11418
11085
|
throw new Error(`Directory "${destination}" is not empty`);
|
|
11419
11086
|
}
|
|
11420
|
-
console.log(
|
|
11087
|
+
console.log(chalk19.dim(`Checking remote ${typeLabel}...`));
|
|
11421
11088
|
const downloadInfo = await getStorageDownload({
|
|
11422
11089
|
name,
|
|
11423
11090
|
type: type2,
|
|
11424
11091
|
version: options.version
|
|
11425
11092
|
});
|
|
11426
|
-
console.log(
|
|
11093
|
+
console.log(chalk19.dim(`Creating directory: ${destination}/`));
|
|
11427
11094
|
await fs8.promises.mkdir(destination, { recursive: true });
|
|
11428
11095
|
if ("empty" in downloadInfo) {
|
|
11429
11096
|
await writeStorageConfig(name, destination, type2);
|
|
11430
|
-
console.log(
|
|
11431
|
-
console.log(
|
|
11097
|
+
console.log(chalk19.green(`\u2713 Cloned empty ${typeLabel}: ${name}`));
|
|
11098
|
+
console.log(chalk19.dim(`\u2713 Initialized .vm0/storage.yaml`));
|
|
11432
11099
|
return {
|
|
11433
11100
|
success: true,
|
|
11434
11101
|
fileCount: 0,
|
|
@@ -11440,7 +11107,7 @@ async function cloneStorage(name, type2, destination, options = {}) {
|
|
|
11440
11107
|
if (!downloadUrl) {
|
|
11441
11108
|
throw new Error("No download URL returned");
|
|
11442
11109
|
}
|
|
11443
|
-
console.log(
|
|
11110
|
+
console.log(chalk19.dim("Downloading from S3..."));
|
|
11444
11111
|
const s3Response = await fetch(downloadUrl);
|
|
11445
11112
|
if (!s3Response.ok) {
|
|
11446
11113
|
await fs8.promises.rm(destination, { recursive: true, force: true });
|
|
@@ -11448,12 +11115,12 @@ async function cloneStorage(name, type2, destination, options = {}) {
|
|
|
11448
11115
|
}
|
|
11449
11116
|
const arrayBuffer = await s3Response.arrayBuffer();
|
|
11450
11117
|
const tarBuffer = Buffer.from(arrayBuffer);
|
|
11451
|
-
console.log(
|
|
11118
|
+
console.log(chalk19.green(`\u2713 Downloaded ${formatBytes(tarBuffer.length)}`));
|
|
11452
11119
|
const tmpDir = fs8.mkdtempSync(path9.join(os6.tmpdir(), "vm0-clone-"));
|
|
11453
11120
|
const tarPath = path9.join(tmpDir, "archive.tar.gz");
|
|
11454
11121
|
await fs8.promises.writeFile(tarPath, tarBuffer);
|
|
11455
11122
|
const files = await listTarFiles(tarPath);
|
|
11456
|
-
console.log(
|
|
11123
|
+
console.log(chalk19.dim("Extracting files..."));
|
|
11457
11124
|
await tar4.extract({
|
|
11458
11125
|
file: tarPath,
|
|
11459
11126
|
cwd: destination,
|
|
@@ -11461,9 +11128,9 @@ async function cloneStorage(name, type2, destination, options = {}) {
|
|
|
11461
11128
|
});
|
|
11462
11129
|
await fs8.promises.unlink(tarPath);
|
|
11463
11130
|
await fs8.promises.rmdir(tmpDir);
|
|
11464
|
-
console.log(
|
|
11131
|
+
console.log(chalk19.green(`\u2713 Extracted ${files.length} files`));
|
|
11465
11132
|
await writeStorageConfig(name, destination, type2);
|
|
11466
|
-
console.log(
|
|
11133
|
+
console.log(chalk19.green(`\u2713 Initialized .vm0/storage.yaml`));
|
|
11467
11134
|
return {
|
|
11468
11135
|
success: true,
|
|
11469
11136
|
fileCount: downloadInfo.fileCount,
|
|
@@ -11478,10 +11145,10 @@ var cloneCommand = new Command19().name("clone").description("Clone a remote vol
|
|
|
11478
11145
|
const targetDir = destination || name;
|
|
11479
11146
|
console.log(`Cloning volume: ${name}`);
|
|
11480
11147
|
const result = await cloneStorage(name, "volume", targetDir);
|
|
11481
|
-
console.log(
|
|
11148
|
+
console.log(chalk20.green(`
|
|
11482
11149
|
\u2713 Successfully cloned volume: ${name}`));
|
|
11483
|
-
console.log(
|
|
11484
|
-
console.log(
|
|
11150
|
+
console.log(chalk20.dim(` Location: ${targetDir}/`));
|
|
11151
|
+
console.log(chalk20.dim(` Version: ${result.versionId.slice(0, 8)}`));
|
|
11485
11152
|
})
|
|
11486
11153
|
);
|
|
11487
11154
|
|
|
@@ -11493,7 +11160,7 @@ import { Command as Command27 } from "commander";
|
|
|
11493
11160
|
|
|
11494
11161
|
// src/commands/artifact/init.ts
|
|
11495
11162
|
import { Command as Command21 } from "commander";
|
|
11496
|
-
import
|
|
11163
|
+
import chalk21 from "chalk";
|
|
11497
11164
|
import path10 from "path";
|
|
11498
11165
|
var initCommand2 = new Command21().name("init").description("Initialize an artifact in the current directory").option(
|
|
11499
11166
|
"-n, --name <name>",
|
|
@@ -11506,24 +11173,24 @@ var initCommand2 = new Command21().name("init").description("Initialize an artif
|
|
|
11506
11173
|
if (existingConfig) {
|
|
11507
11174
|
if (existingConfig.type === "artifact") {
|
|
11508
11175
|
console.log(
|
|
11509
|
-
|
|
11176
|
+
chalk21.yellow(
|
|
11510
11177
|
`Artifact already initialized: ${existingConfig.name}`
|
|
11511
11178
|
)
|
|
11512
11179
|
);
|
|
11513
11180
|
} else {
|
|
11514
11181
|
console.log(
|
|
11515
|
-
|
|
11182
|
+
chalk21.yellow(
|
|
11516
11183
|
`Directory already initialized as volume: ${existingConfig.name}`
|
|
11517
11184
|
)
|
|
11518
11185
|
);
|
|
11519
11186
|
console.log(
|
|
11520
|
-
|
|
11187
|
+
chalk21.dim(
|
|
11521
11188
|
" To change type, delete .vm0/storage.yaml and reinitialize"
|
|
11522
11189
|
)
|
|
11523
11190
|
);
|
|
11524
11191
|
}
|
|
11525
11192
|
console.log(
|
|
11526
|
-
|
|
11193
|
+
chalk21.dim(`Config file: ${path10.join(cwd, ".vm0", "storage.yaml")}`)
|
|
11527
11194
|
);
|
|
11528
11195
|
return;
|
|
11529
11196
|
}
|
|
@@ -11547,7 +11214,7 @@ var initCommand2 = new Command21().name("init").description("Initialize an artif
|
|
|
11547
11214
|
}
|
|
11548
11215
|
);
|
|
11549
11216
|
if (name === void 0) {
|
|
11550
|
-
console.log(
|
|
11217
|
+
console.log(chalk21.dim("Cancelled"));
|
|
11551
11218
|
return;
|
|
11552
11219
|
}
|
|
11553
11220
|
artifactName = name;
|
|
@@ -11560,9 +11227,9 @@ var initCommand2 = new Command21().name("init").description("Initialize an artif
|
|
|
11560
11227
|
});
|
|
11561
11228
|
}
|
|
11562
11229
|
await writeStorageConfig(artifactName, cwd, "artifact");
|
|
11563
|
-
console.log(
|
|
11230
|
+
console.log(chalk21.green(`\u2713 Initialized artifact: ${artifactName}`));
|
|
11564
11231
|
console.log(
|
|
11565
|
-
|
|
11232
|
+
chalk21.dim(
|
|
11566
11233
|
` Config saved to ${path10.join(cwd, ".vm0", "storage.yaml")}`
|
|
11567
11234
|
)
|
|
11568
11235
|
);
|
|
@@ -11571,7 +11238,7 @@ var initCommand2 = new Command21().name("init").description("Initialize an artif
|
|
|
11571
11238
|
|
|
11572
11239
|
// src/commands/artifact/push.ts
|
|
11573
11240
|
import { Command as Command22 } from "commander";
|
|
11574
|
-
import
|
|
11241
|
+
import chalk22 from "chalk";
|
|
11575
11242
|
var pushCommand2 = new Command22().name("push").description("Push local files to cloud artifact").option(
|
|
11576
11243
|
"-f, --force",
|
|
11577
11244
|
"Force upload even if content unchanged (recreate archive)"
|
|
@@ -11593,27 +11260,27 @@ var pushCommand2 = new Command22().name("push").description("Push local files to
|
|
|
11593
11260
|
console.log(`Pushing artifact: ${config.name}`);
|
|
11594
11261
|
const result = await directUpload(config.name, "artifact", cwd, {
|
|
11595
11262
|
onProgress: (message) => {
|
|
11596
|
-
console.log(
|
|
11263
|
+
console.log(chalk22.dim(message));
|
|
11597
11264
|
},
|
|
11598
11265
|
force: options.force
|
|
11599
11266
|
});
|
|
11600
11267
|
const shortVersion = result.versionId.slice(0, 8);
|
|
11601
11268
|
if (result.empty) {
|
|
11602
|
-
console.log(
|
|
11269
|
+
console.log(chalk22.dim("No files found (empty artifact)"));
|
|
11603
11270
|
} else if (result.deduplicated) {
|
|
11604
|
-
console.log(
|
|
11271
|
+
console.log(chalk22.green("\u2713 Content unchanged (deduplicated)"));
|
|
11605
11272
|
} else {
|
|
11606
|
-
console.log(
|
|
11273
|
+
console.log(chalk22.green("\u2713 Upload complete"));
|
|
11607
11274
|
}
|
|
11608
|
-
console.log(
|
|
11609
|
-
console.log(
|
|
11610
|
-
console.log(
|
|
11275
|
+
console.log(chalk22.dim(` Version: ${shortVersion}`));
|
|
11276
|
+
console.log(chalk22.dim(` Files: ${result.fileCount.toLocaleString()}`));
|
|
11277
|
+
console.log(chalk22.dim(` Size: ${formatBytes(result.size)}`));
|
|
11611
11278
|
})
|
|
11612
11279
|
);
|
|
11613
11280
|
|
|
11614
11281
|
// src/commands/artifact/pull.ts
|
|
11615
11282
|
import { Command as Command23 } from "commander";
|
|
11616
|
-
import
|
|
11283
|
+
import chalk23 from "chalk";
|
|
11617
11284
|
import path11 from "path";
|
|
11618
11285
|
import * as fs9 from "fs";
|
|
11619
11286
|
import * as os7 from "os";
|
|
@@ -11638,7 +11305,7 @@ var pullCommand2 = new Command23().name("pull").description("Pull cloud artifact
|
|
|
11638
11305
|
} else {
|
|
11639
11306
|
console.log(`Pulling artifact: ${config.name}`);
|
|
11640
11307
|
}
|
|
11641
|
-
console.log(
|
|
11308
|
+
console.log(chalk23.dim("Getting download URL..."));
|
|
11642
11309
|
const downloadInfo = await getStorageDownload({
|
|
11643
11310
|
name: config.name,
|
|
11644
11311
|
type: "artifact",
|
|
@@ -11652,18 +11319,18 @@ var pullCommand2 = new Command23().name("pull").description("Pull cloud artifact
|
|
|
11652
11319
|
if (!downloadUrl) {
|
|
11653
11320
|
throw new Error("No download URL returned");
|
|
11654
11321
|
}
|
|
11655
|
-
console.log(
|
|
11322
|
+
console.log(chalk23.dim("Downloading from S3..."));
|
|
11656
11323
|
const s3Response = await fetch(downloadUrl);
|
|
11657
11324
|
if (!s3Response.ok) {
|
|
11658
11325
|
throw new Error(`S3 download failed: ${s3Response.status}`);
|
|
11659
11326
|
}
|
|
11660
11327
|
const arrayBuffer = await s3Response.arrayBuffer();
|
|
11661
11328
|
const tarBuffer = Buffer.from(arrayBuffer);
|
|
11662
|
-
console.log(
|
|
11329
|
+
console.log(chalk23.green(`\u2713 Downloaded ${formatBytes(tarBuffer.length)}`));
|
|
11663
11330
|
const tmpDir = fs9.mkdtempSync(path11.join(os7.tmpdir(), "vm0-"));
|
|
11664
11331
|
const tarPath = path11.join(tmpDir, "artifact.tar.gz");
|
|
11665
11332
|
await fs9.promises.writeFile(tarPath, tarBuffer);
|
|
11666
|
-
console.log(
|
|
11333
|
+
console.log(chalk23.dim("Syncing local files..."));
|
|
11667
11334
|
const remoteFiles = await listTarFiles(tarPath);
|
|
11668
11335
|
const remoteFilesSet = new Set(
|
|
11669
11336
|
remoteFiles.map((f) => f.replace(/\\/g, "/"))
|
|
@@ -11671,10 +11338,10 @@ var pullCommand2 = new Command23().name("pull").description("Pull cloud artifact
|
|
|
11671
11338
|
const removedCount = await removeExtraFiles(cwd, remoteFilesSet);
|
|
11672
11339
|
if (removedCount > 0) {
|
|
11673
11340
|
console.log(
|
|
11674
|
-
|
|
11341
|
+
chalk23.green(`\u2713 Removed ${removedCount} files not in remote`)
|
|
11675
11342
|
);
|
|
11676
11343
|
}
|
|
11677
|
-
console.log(
|
|
11344
|
+
console.log(chalk23.dim("Extracting files..."));
|
|
11678
11345
|
await tar5.extract({
|
|
11679
11346
|
file: tarPath,
|
|
11680
11347
|
cwd,
|
|
@@ -11682,13 +11349,13 @@ var pullCommand2 = new Command23().name("pull").description("Pull cloud artifact
|
|
|
11682
11349
|
});
|
|
11683
11350
|
await fs9.promises.unlink(tarPath);
|
|
11684
11351
|
await fs9.promises.rmdir(tmpDir);
|
|
11685
|
-
console.log(
|
|
11352
|
+
console.log(chalk23.green(`\u2713 Extracted ${remoteFiles.length} files`));
|
|
11686
11353
|
})
|
|
11687
11354
|
);
|
|
11688
11355
|
|
|
11689
11356
|
// src/commands/artifact/status.ts
|
|
11690
11357
|
import { Command as Command24 } from "commander";
|
|
11691
|
-
import
|
|
11358
|
+
import chalk24 from "chalk";
|
|
11692
11359
|
var statusCommand3 = new Command24().name("status").description("Show status of cloud artifact").action(
|
|
11693
11360
|
withErrorHandler(async () => {
|
|
11694
11361
|
const cwd = process.cwd();
|
|
@@ -11712,13 +11379,13 @@ var statusCommand3 = new Command24().name("status").description("Show status of
|
|
|
11712
11379
|
});
|
|
11713
11380
|
const shortVersion = info.versionId.slice(0, 8);
|
|
11714
11381
|
if ("empty" in info) {
|
|
11715
|
-
console.log(
|
|
11716
|
-
console.log(
|
|
11382
|
+
console.log(chalk24.green("\u2713 Found (empty)"));
|
|
11383
|
+
console.log(chalk24.dim(` Version: ${shortVersion}`));
|
|
11717
11384
|
} else {
|
|
11718
|
-
console.log(
|
|
11719
|
-
console.log(
|
|
11720
|
-
console.log(
|
|
11721
|
-
console.log(
|
|
11385
|
+
console.log(chalk24.green("\u2713 Found"));
|
|
11386
|
+
console.log(chalk24.dim(` Version: ${shortVersion}`));
|
|
11387
|
+
console.log(chalk24.dim(` Files: ${info.fileCount.toLocaleString()}`));
|
|
11388
|
+
console.log(chalk24.dim(` Size: ${formatBytes(info.size)}`));
|
|
11722
11389
|
}
|
|
11723
11390
|
} catch (error) {
|
|
11724
11391
|
if (error instanceof ApiRequestError && error.status === 404) {
|
|
@@ -11733,14 +11400,14 @@ var statusCommand3 = new Command24().name("status").description("Show status of
|
|
|
11733
11400
|
|
|
11734
11401
|
// src/commands/artifact/list.ts
|
|
11735
11402
|
import { Command as Command25 } from "commander";
|
|
11736
|
-
import
|
|
11403
|
+
import chalk25 from "chalk";
|
|
11737
11404
|
var listCommand3 = new Command25().name("list").alias("ls").description("List all remote artifacts").action(
|
|
11738
11405
|
withErrorHandler(async () => {
|
|
11739
11406
|
const items = await listStorages({ type: "artifact" });
|
|
11740
11407
|
if (items.length === 0) {
|
|
11741
|
-
console.log(
|
|
11408
|
+
console.log(chalk25.dim("No artifacts found"));
|
|
11742
11409
|
console.log(
|
|
11743
|
-
|
|
11410
|
+
chalk25.dim(
|
|
11744
11411
|
" Create one with: vm0 artifact init && vm0 artifact push"
|
|
11745
11412
|
)
|
|
11746
11413
|
);
|
|
@@ -11761,7 +11428,7 @@ var listCommand3 = new Command25().name("list").alias("ls").description("List al
|
|
|
11761
11428
|
"FILES".padStart(filesWidth),
|
|
11762
11429
|
"UPDATED"
|
|
11763
11430
|
].join(" ");
|
|
11764
|
-
console.log(
|
|
11431
|
+
console.log(chalk25.dim(header));
|
|
11765
11432
|
for (const item of items) {
|
|
11766
11433
|
const row = [
|
|
11767
11434
|
item.name.padEnd(nameWidth),
|
|
@@ -11776,16 +11443,16 @@ var listCommand3 = new Command25().name("list").alias("ls").description("List al
|
|
|
11776
11443
|
|
|
11777
11444
|
// src/commands/artifact/clone.ts
|
|
11778
11445
|
import { Command as Command26 } from "commander";
|
|
11779
|
-
import
|
|
11446
|
+
import chalk26 from "chalk";
|
|
11780
11447
|
var cloneCommand2 = new Command26().name("clone").description("Clone a remote artifact to local directory (latest version)").argument("<name>", "Artifact name to clone").argument("[destination]", "Destination directory (default: artifact name)").action(
|
|
11781
11448
|
withErrorHandler(async (name, destination) => {
|
|
11782
11449
|
const targetDir = destination || name;
|
|
11783
11450
|
console.log(`Cloning artifact: ${name}`);
|
|
11784
11451
|
const result = await cloneStorage(name, "artifact", targetDir);
|
|
11785
|
-
console.log(
|
|
11452
|
+
console.log(chalk26.green(`
|
|
11786
11453
|
\u2713 Successfully cloned artifact: ${name}`));
|
|
11787
|
-
console.log(
|
|
11788
|
-
console.log(
|
|
11454
|
+
console.log(chalk26.dim(` Location: ${targetDir}/`));
|
|
11455
|
+
console.log(chalk26.dim(` Version: ${result.versionId.slice(0, 8)}`));
|
|
11789
11456
|
})
|
|
11790
11457
|
);
|
|
11791
11458
|
|
|
@@ -11797,7 +11464,7 @@ import { Command as Command34 } from "commander";
|
|
|
11797
11464
|
|
|
11798
11465
|
// src/commands/memory/init.ts
|
|
11799
11466
|
import { Command as Command28 } from "commander";
|
|
11800
|
-
import
|
|
11467
|
+
import chalk27 from "chalk";
|
|
11801
11468
|
import path12 from "path";
|
|
11802
11469
|
var initCommand3 = new Command28().name("init").description("Initialize a memory in the current directory").option("-n, --name <name>", "Memory name (required in non-interactive mode)").action(
|
|
11803
11470
|
withErrorHandler(async (options) => {
|
|
@@ -11807,22 +11474,22 @@ var initCommand3 = new Command28().name("init").description("Initialize a memory
|
|
|
11807
11474
|
if (existingConfig) {
|
|
11808
11475
|
if (existingConfig.type === "memory") {
|
|
11809
11476
|
console.log(
|
|
11810
|
-
|
|
11477
|
+
chalk27.yellow(`Memory already initialized: ${existingConfig.name}`)
|
|
11811
11478
|
);
|
|
11812
11479
|
} else {
|
|
11813
11480
|
console.log(
|
|
11814
|
-
|
|
11481
|
+
chalk27.yellow(
|
|
11815
11482
|
`Directory already initialized as ${existingConfig.type}: ${existingConfig.name}`
|
|
11816
11483
|
)
|
|
11817
11484
|
);
|
|
11818
11485
|
console.log(
|
|
11819
|
-
|
|
11486
|
+
chalk27.dim(
|
|
11820
11487
|
" To change type, delete .vm0/storage.yaml and reinitialize"
|
|
11821
11488
|
)
|
|
11822
11489
|
);
|
|
11823
11490
|
}
|
|
11824
11491
|
console.log(
|
|
11825
|
-
|
|
11492
|
+
chalk27.dim(`Config file: ${path12.join(cwd, ".vm0", "storage.yaml")}`)
|
|
11826
11493
|
);
|
|
11827
11494
|
return;
|
|
11828
11495
|
}
|
|
@@ -11846,7 +11513,7 @@ var initCommand3 = new Command28().name("init").description("Initialize a memory
|
|
|
11846
11513
|
}
|
|
11847
11514
|
);
|
|
11848
11515
|
if (name === void 0) {
|
|
11849
|
-
console.log(
|
|
11516
|
+
console.log(chalk27.dim("Cancelled"));
|
|
11850
11517
|
return;
|
|
11851
11518
|
}
|
|
11852
11519
|
memoryName = name;
|
|
@@ -11859,9 +11526,9 @@ var initCommand3 = new Command28().name("init").description("Initialize a memory
|
|
|
11859
11526
|
});
|
|
11860
11527
|
}
|
|
11861
11528
|
await writeStorageConfig(memoryName, cwd, "memory");
|
|
11862
|
-
console.log(
|
|
11529
|
+
console.log(chalk27.green(`\u2713 Initialized memory: ${memoryName}`));
|
|
11863
11530
|
console.log(
|
|
11864
|
-
|
|
11531
|
+
chalk27.dim(
|
|
11865
11532
|
` Config saved to ${path12.join(cwd, ".vm0", "storage.yaml")}`
|
|
11866
11533
|
)
|
|
11867
11534
|
);
|
|
@@ -11870,7 +11537,7 @@ var initCommand3 = new Command28().name("init").description("Initialize a memory
|
|
|
11870
11537
|
|
|
11871
11538
|
// src/commands/memory/push.ts
|
|
11872
11539
|
import { Command as Command29 } from "commander";
|
|
11873
|
-
import
|
|
11540
|
+
import chalk28 from "chalk";
|
|
11874
11541
|
var pushCommand3 = new Command29().name("push").description("Push local files to cloud memory").option(
|
|
11875
11542
|
"-f, --force",
|
|
11876
11543
|
"Force upload even if content unchanged (recreate archive)"
|
|
@@ -11892,42 +11559,42 @@ var pushCommand3 = new Command29().name("push").description("Push local files to
|
|
|
11892
11559
|
console.log(`Pushing memory: ${config.name}`);
|
|
11893
11560
|
const result = await directUpload(config.name, "memory", cwd, {
|
|
11894
11561
|
onProgress: (message) => {
|
|
11895
|
-
console.log(
|
|
11562
|
+
console.log(chalk28.dim(message));
|
|
11896
11563
|
},
|
|
11897
11564
|
force: options.force
|
|
11898
11565
|
});
|
|
11899
11566
|
const shortVersion = result.versionId.slice(0, 8);
|
|
11900
11567
|
if (result.empty) {
|
|
11901
|
-
console.log(
|
|
11568
|
+
console.log(chalk28.dim("No files found (empty memory)"));
|
|
11902
11569
|
} else if (result.deduplicated) {
|
|
11903
|
-
console.log(
|
|
11570
|
+
console.log(chalk28.green("\u2713 Content unchanged (deduplicated)"));
|
|
11904
11571
|
} else {
|
|
11905
|
-
console.log(
|
|
11572
|
+
console.log(chalk28.green("\u2713 Upload complete"));
|
|
11906
11573
|
}
|
|
11907
|
-
console.log(
|
|
11908
|
-
console.log(
|
|
11909
|
-
console.log(
|
|
11574
|
+
console.log(chalk28.dim(` Version: ${shortVersion}`));
|
|
11575
|
+
console.log(chalk28.dim(` Files: ${result.fileCount.toLocaleString()}`));
|
|
11576
|
+
console.log(chalk28.dim(` Size: ${formatBytes(result.size)}`));
|
|
11910
11577
|
})
|
|
11911
11578
|
);
|
|
11912
11579
|
|
|
11913
11580
|
// src/commands/memory/pull.ts
|
|
11914
11581
|
import { Command as Command30 } from "commander";
|
|
11915
|
-
import
|
|
11582
|
+
import chalk29 from "chalk";
|
|
11916
11583
|
var pullCommand3 = new Command30().name("pull").description("Pull remote memory to local directory (latest version)").argument("[name]", "Memory name to pull", "memory").argument("[destination]", "Destination directory (default: memory name)").action(
|
|
11917
11584
|
withErrorHandler(async (name, destination) => {
|
|
11918
11585
|
const targetDir = destination || name;
|
|
11919
11586
|
console.log(`Pulling memory: ${name}`);
|
|
11920
11587
|
const result = await cloneStorage(name, "memory", targetDir);
|
|
11921
|
-
console.log(
|
|
11588
|
+
console.log(chalk29.green(`
|
|
11922
11589
|
\u2713 Successfully pulled memory: ${name}`));
|
|
11923
|
-
console.log(
|
|
11924
|
-
console.log(
|
|
11590
|
+
console.log(chalk29.dim(` Location: ${targetDir}/`));
|
|
11591
|
+
console.log(chalk29.dim(` Version: ${result.versionId.slice(0, 8)}`));
|
|
11925
11592
|
})
|
|
11926
11593
|
);
|
|
11927
11594
|
|
|
11928
11595
|
// src/commands/memory/status.ts
|
|
11929
11596
|
import { Command as Command31 } from "commander";
|
|
11930
|
-
import
|
|
11597
|
+
import chalk30 from "chalk";
|
|
11931
11598
|
var statusCommand4 = new Command31().name("status").description("Show status of cloud memory").action(
|
|
11932
11599
|
withErrorHandler(async () => {
|
|
11933
11600
|
const cwd = process.cwd();
|
|
@@ -11951,13 +11618,13 @@ var statusCommand4 = new Command31().name("status").description("Show status of
|
|
|
11951
11618
|
});
|
|
11952
11619
|
const shortVersion = info.versionId.slice(0, 8);
|
|
11953
11620
|
if ("empty" in info) {
|
|
11954
|
-
console.log(
|
|
11955
|
-
console.log(
|
|
11621
|
+
console.log(chalk30.green("\u2713 Found (empty)"));
|
|
11622
|
+
console.log(chalk30.dim(` Version: ${shortVersion}`));
|
|
11956
11623
|
} else {
|
|
11957
|
-
console.log(
|
|
11958
|
-
console.log(
|
|
11959
|
-
console.log(
|
|
11960
|
-
console.log(
|
|
11624
|
+
console.log(chalk30.green("\u2713 Found"));
|
|
11625
|
+
console.log(chalk30.dim(` Version: ${shortVersion}`));
|
|
11626
|
+
console.log(chalk30.dim(` Files: ${info.fileCount.toLocaleString()}`));
|
|
11627
|
+
console.log(chalk30.dim(` Size: ${formatBytes(info.size)}`));
|
|
11961
11628
|
}
|
|
11962
11629
|
} catch (error) {
|
|
11963
11630
|
if (error instanceof ApiRequestError && error.status === 404) {
|
|
@@ -11972,14 +11639,14 @@ var statusCommand4 = new Command31().name("status").description("Show status of
|
|
|
11972
11639
|
|
|
11973
11640
|
// src/commands/memory/list.ts
|
|
11974
11641
|
import { Command as Command32 } from "commander";
|
|
11975
|
-
import
|
|
11642
|
+
import chalk31 from "chalk";
|
|
11976
11643
|
var listCommand4 = new Command32().name("list").alias("ls").description("List all remote memory storages").action(
|
|
11977
11644
|
withErrorHandler(async () => {
|
|
11978
11645
|
const items = await listStorages({ type: "memory" });
|
|
11979
11646
|
if (items.length === 0) {
|
|
11980
|
-
console.log(
|
|
11647
|
+
console.log(chalk31.dim("No memory storages found"));
|
|
11981
11648
|
console.log(
|
|
11982
|
-
|
|
11649
|
+
chalk31.dim(" Memory is created automatically on first agent run")
|
|
11983
11650
|
);
|
|
11984
11651
|
return;
|
|
11985
11652
|
}
|
|
@@ -11998,7 +11665,7 @@ var listCommand4 = new Command32().name("list").alias("ls").description("List al
|
|
|
11998
11665
|
"FILES".padStart(filesWidth),
|
|
11999
11666
|
"UPDATED"
|
|
12000
11667
|
].join(" ");
|
|
12001
|
-
console.log(
|
|
11668
|
+
console.log(chalk31.dim(header));
|
|
12002
11669
|
for (const item of items) {
|
|
12003
11670
|
const row = [
|
|
12004
11671
|
item.name.padEnd(nameWidth),
|
|
@@ -12013,16 +11680,16 @@ var listCommand4 = new Command32().name("list").alias("ls").description("List al
|
|
|
12013
11680
|
|
|
12014
11681
|
// src/commands/memory/clone.ts
|
|
12015
11682
|
import { Command as Command33 } from "commander";
|
|
12016
|
-
import
|
|
11683
|
+
import chalk32 from "chalk";
|
|
12017
11684
|
var cloneCommand3 = new Command33().name("clone").description("Clone a remote memory to local directory (latest version)").argument("<name>", "Memory name to clone").argument("[destination]", "Destination directory (default: memory name)").action(
|
|
12018
11685
|
withErrorHandler(async (name, destination) => {
|
|
12019
11686
|
const targetDir = destination || name;
|
|
12020
11687
|
console.log(`Cloning memory: ${name}`);
|
|
12021
11688
|
const result = await cloneStorage(name, "memory", targetDir);
|
|
12022
|
-
console.log(
|
|
11689
|
+
console.log(chalk32.green(`
|
|
12023
11690
|
\u2713 Successfully cloned memory: ${name}`));
|
|
12024
|
-
console.log(
|
|
12025
|
-
console.log(
|
|
11691
|
+
console.log(chalk32.dim(` Location: ${targetDir}/`));
|
|
11692
|
+
console.log(chalk32.dim(` Version: ${result.versionId.slice(0, 8)}`));
|
|
12026
11693
|
})
|
|
12027
11694
|
);
|
|
12028
11695
|
|
|
@@ -12031,7 +11698,7 @@ var memoryCommand = new Command34().name("memory").description("Manage agent lon
|
|
|
12031
11698
|
|
|
12032
11699
|
// src/commands/cook/cook.ts
|
|
12033
11700
|
import { Command as Command35, Option as Option5 } from "commander";
|
|
12034
|
-
import
|
|
11701
|
+
import chalk34 from "chalk";
|
|
12035
11702
|
import { readFile as readFile7, mkdir as mkdir6 } from "fs/promises";
|
|
12036
11703
|
import { existsSync as existsSync10 } from "fs";
|
|
12037
11704
|
import path13 from "path";
|
|
@@ -12103,12 +11770,12 @@ async function saveCookState(state) {
|
|
|
12103
11770
|
}
|
|
12104
11771
|
|
|
12105
11772
|
// src/commands/cook/utils.ts
|
|
12106
|
-
import
|
|
11773
|
+
import chalk33 from "chalk";
|
|
12107
11774
|
import { existsSync as existsSync9 } from "fs";
|
|
12108
11775
|
var CONFIG_FILE2 = "vm0.yaml";
|
|
12109
11776
|
var ARTIFACT_DIR = "artifact";
|
|
12110
11777
|
function printCommand(cmd) {
|
|
12111
|
-
console.log(
|
|
11778
|
+
console.log(chalk33.dim(`> ${cmd}`));
|
|
12112
11779
|
}
|
|
12113
11780
|
function execVm0Command(args, options = {}) {
|
|
12114
11781
|
return new Promise((resolve2, reject) => {
|
|
@@ -12207,7 +11874,7 @@ async function autoPullArtifact(runOutput, artifactDir) {
|
|
|
12207
11874
|
);
|
|
12208
11875
|
if (serverVersion && existsSync9(artifactDir)) {
|
|
12209
11876
|
console.log();
|
|
12210
|
-
console.log(
|
|
11877
|
+
console.log(chalk33.bold("Pulling updated artifact:"));
|
|
12211
11878
|
printCommand(`cd ${ARTIFACT_DIR}`);
|
|
12212
11879
|
printCommand(`vm0 artifact pull ${serverVersion}`);
|
|
12213
11880
|
try {
|
|
@@ -12217,9 +11884,9 @@ async function autoPullArtifact(runOutput, artifactDir) {
|
|
|
12217
11884
|
});
|
|
12218
11885
|
printCommand("cd ..");
|
|
12219
11886
|
} catch (error) {
|
|
12220
|
-
console.error(
|
|
11887
|
+
console.error(chalk33.red(`\u2717 Artifact pull failed`));
|
|
12221
11888
|
if (error instanceof Error) {
|
|
12222
|
-
console.error(
|
|
11889
|
+
console.error(chalk33.dim(` ${error.message}`));
|
|
12223
11890
|
}
|
|
12224
11891
|
}
|
|
12225
11892
|
}
|
|
@@ -12227,7 +11894,7 @@ async function autoPullArtifact(runOutput, artifactDir) {
|
|
|
12227
11894
|
|
|
12228
11895
|
// src/commands/cook/cook.ts
|
|
12229
11896
|
async function loadAndValidateConfig2() {
|
|
12230
|
-
console.log(
|
|
11897
|
+
console.log(chalk34.bold(`Reading config: ${CONFIG_FILE2}`));
|
|
12231
11898
|
if (!existsSync10(CONFIG_FILE2)) {
|
|
12232
11899
|
throw new Error(`Config file not found: ${CONFIG_FILE2}`);
|
|
12233
11900
|
}
|
|
@@ -12249,7 +11916,7 @@ async function loadAndValidateConfig2() {
|
|
|
12249
11916
|
const agentName = agentNames[0];
|
|
12250
11917
|
const volumeCount = config.volumes ? Object.keys(config.volumes).length : 0;
|
|
12251
11918
|
console.log(
|
|
12252
|
-
|
|
11919
|
+
chalk34.green(`\u2713 Config validated: 1 agent, ${volumeCount} volume(s)`)
|
|
12253
11920
|
);
|
|
12254
11921
|
return { config, agentName, volumeCount };
|
|
12255
11922
|
}
|
|
@@ -12258,7 +11925,7 @@ async function processVolumes(config, cwd) {
|
|
|
12258
11925
|
return;
|
|
12259
11926
|
}
|
|
12260
11927
|
console.log();
|
|
12261
|
-
console.log(
|
|
11928
|
+
console.log(chalk34.bold("Processing volumes:"));
|
|
12262
11929
|
for (const volumeConfig of Object.values(config.volumes)) {
|
|
12263
11930
|
const volumeDir = path13.join(cwd, volumeConfig.name);
|
|
12264
11931
|
if (!existsSync10(volumeDir)) {
|
|
@@ -12292,7 +11959,7 @@ async function processVolumes(config, cwd) {
|
|
|
12292
11959
|
}
|
|
12293
11960
|
async function processArtifact(cwd) {
|
|
12294
11961
|
console.log();
|
|
12295
|
-
console.log(
|
|
11962
|
+
console.log(chalk34.bold("Processing artifact:"));
|
|
12296
11963
|
const artifactDir = path13.join(cwd, ARTIFACT_DIR);
|
|
12297
11964
|
try {
|
|
12298
11965
|
if (!existsSync10(artifactDir)) {
|
|
@@ -12324,7 +11991,7 @@ async function processArtifact(cwd) {
|
|
|
12324
11991
|
}
|
|
12325
11992
|
async function composeAgent(cwd, skipConfirm) {
|
|
12326
11993
|
console.log();
|
|
12327
|
-
console.log(
|
|
11994
|
+
console.log(chalk34.bold("Composing agent:"));
|
|
12328
11995
|
const composeArgs = skipConfirm ? ["compose", "--yes", CONFIG_FILE2] : ["compose", CONFIG_FILE2];
|
|
12329
11996
|
printCommand(`vm0 ${composeArgs.join(" ")}`);
|
|
12330
11997
|
try {
|
|
@@ -12338,7 +12005,7 @@ async function composeAgent(cwd, skipConfirm) {
|
|
|
12338
12005
|
}
|
|
12339
12006
|
async function runAgent(agentName, artifactDir, prompt, cwd, options) {
|
|
12340
12007
|
console.log();
|
|
12341
|
-
console.log(
|
|
12008
|
+
console.log(chalk34.bold("Running agent:"));
|
|
12342
12009
|
printCommand(
|
|
12343
12010
|
`vm0 run ${agentName} --artifact-name ${ARTIFACT_DIR} "${prompt}"`
|
|
12344
12011
|
);
|
|
@@ -12371,7 +12038,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
|
|
|
12371
12038
|
withErrorHandler(
|
|
12372
12039
|
async (prompt, options) => {
|
|
12373
12040
|
if (options.autoUpdate !== false) {
|
|
12374
|
-
const shouldExit = await checkAndUpgrade("9.62.
|
|
12041
|
+
const shouldExit = await checkAndUpgrade("9.62.2", prompt);
|
|
12375
12042
|
if (shouldExit) {
|
|
12376
12043
|
process.exit(0);
|
|
12377
12044
|
}
|
|
@@ -12554,7 +12221,7 @@ var cookCommand = cookAction;
|
|
|
12554
12221
|
|
|
12555
12222
|
// src/commands/logs/index.ts
|
|
12556
12223
|
import { Command as Command40 } from "commander";
|
|
12557
|
-
import
|
|
12224
|
+
import chalk36 from "chalk";
|
|
12558
12225
|
|
|
12559
12226
|
// src/lib/api/api-client.ts
|
|
12560
12227
|
import { initClient as initClient12 } from "@ts-rest/core";
|
|
@@ -13252,7 +12919,7 @@ async function paginate(options) {
|
|
|
13252
12919
|
|
|
13253
12920
|
// src/commands/logs/search.ts
|
|
13254
12921
|
import { Command as Command39 } from "commander";
|
|
13255
|
-
import
|
|
12922
|
+
import chalk35 from "chalk";
|
|
13256
12923
|
var SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
13257
12924
|
function renderEvent(event, renderer) {
|
|
13258
12925
|
const eventData = event.eventData;
|
|
@@ -13308,7 +12975,7 @@ function renderResults(response) {
|
|
|
13308
12975
|
isFirstGroup = false;
|
|
13309
12976
|
const firstTimestamp = group.results[0].matchedEvent.createdAt;
|
|
13310
12977
|
console.log(
|
|
13311
|
-
|
|
12978
|
+
chalk35.bold(formatRunHeader(runId, group.agentName, firstTimestamp))
|
|
13312
12979
|
);
|
|
13313
12980
|
for (const result of group.results) {
|
|
13314
12981
|
const renderer = new EventRenderer({
|
|
@@ -13328,7 +12995,7 @@ function renderResults(response) {
|
|
|
13328
12995
|
if (response.hasMore) {
|
|
13329
12996
|
console.log();
|
|
13330
12997
|
console.log(
|
|
13331
|
-
|
|
12998
|
+
chalk35.dim(
|
|
13332
12999
|
` Showing first ${response.results.length} matches. Use --limit to see more.`
|
|
13333
13000
|
)
|
|
13334
13001
|
);
|
|
@@ -13349,9 +13016,9 @@ var searchCommand = new Command39().name("search").description("Search agent eve
|
|
|
13349
13016
|
after
|
|
13350
13017
|
});
|
|
13351
13018
|
if (response.results.length === 0) {
|
|
13352
|
-
console.log(
|
|
13019
|
+
console.log(chalk35.dim("No matches found"));
|
|
13353
13020
|
console.log(
|
|
13354
|
-
|
|
13021
|
+
chalk35.dim(
|
|
13355
13022
|
" Try a broader search with --since 30d or a different keyword"
|
|
13356
13023
|
)
|
|
13357
13024
|
);
|
|
@@ -13388,28 +13055,28 @@ function formatNetworkLog(entry) {
|
|
|
13388
13055
|
let statusColor;
|
|
13389
13056
|
const status = entry.status || 0;
|
|
13390
13057
|
if (status >= 200 && status < 300) {
|
|
13391
|
-
statusColor =
|
|
13058
|
+
statusColor = chalk36.green;
|
|
13392
13059
|
} else if (status >= 300 && status < 400) {
|
|
13393
|
-
statusColor =
|
|
13060
|
+
statusColor = chalk36.yellow;
|
|
13394
13061
|
} else if (status >= 400) {
|
|
13395
|
-
statusColor =
|
|
13062
|
+
statusColor = chalk36.red;
|
|
13396
13063
|
} else {
|
|
13397
|
-
statusColor =
|
|
13064
|
+
statusColor = chalk36.gray;
|
|
13398
13065
|
}
|
|
13399
13066
|
let latencyColor;
|
|
13400
13067
|
const latencyMs = entry.latency_ms || 0;
|
|
13401
13068
|
if (latencyMs < 500) {
|
|
13402
|
-
latencyColor =
|
|
13069
|
+
latencyColor = chalk36.green;
|
|
13403
13070
|
} else if (latencyMs < 2e3) {
|
|
13404
|
-
latencyColor =
|
|
13071
|
+
latencyColor = chalk36.yellow;
|
|
13405
13072
|
} else {
|
|
13406
|
-
latencyColor =
|
|
13073
|
+
latencyColor = chalk36.red;
|
|
13407
13074
|
}
|
|
13408
13075
|
const method = entry.method || "???";
|
|
13409
13076
|
const requestSize = entry.request_size || 0;
|
|
13410
13077
|
const responseSize = entry.response_size || 0;
|
|
13411
13078
|
const url = entry.url || entry.host || "unknown";
|
|
13412
|
-
return `[${entry.timestamp}] ${method.padEnd(6)} ${statusColor(status)} ${latencyColor(latencyMs + "ms")} ${formatBytes(requestSize)}/${formatBytes(responseSize)} ${
|
|
13079
|
+
return `[${entry.timestamp}] ${method.padEnd(6)} ${statusColor(status)} ${latencyColor(latencyMs + "ms")} ${formatBytes(requestSize)}/${formatBytes(responseSize)} ${chalk36.dim(url)}`;
|
|
13413
13080
|
}
|
|
13414
13081
|
function createLogRenderer(verbose) {
|
|
13415
13082
|
return new EventRenderer({
|
|
@@ -13417,16 +13084,12 @@ function createLogRenderer(verbose) {
|
|
|
13417
13084
|
verbose
|
|
13418
13085
|
});
|
|
13419
13086
|
}
|
|
13420
|
-
function renderAgentEvent(event,
|
|
13087
|
+
function renderAgentEvent(event, renderer) {
|
|
13421
13088
|
const eventData = event.eventData;
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
if (parsed) {
|
|
13427
|
-
parsed.timestamp = new Date(event.createdAt);
|
|
13428
|
-
renderer.render(parsed);
|
|
13429
|
-
}
|
|
13089
|
+
const parsed = ClaudeEventParser.parse(eventData);
|
|
13090
|
+
if (parsed) {
|
|
13091
|
+
parsed.timestamp = new Date(event.createdAt);
|
|
13092
|
+
renderer.render(parsed);
|
|
13430
13093
|
}
|
|
13431
13094
|
}
|
|
13432
13095
|
function getLogType(options) {
|
|
@@ -13515,10 +13178,9 @@ async function showAgentEvents(runId, options, platformUrl) {
|
|
|
13515
13178
|
order: options.order
|
|
13516
13179
|
});
|
|
13517
13180
|
if (firstResponse.events.length === 0) {
|
|
13518
|
-
console.log(
|
|
13181
|
+
console.log(chalk36.yellow("No agent events found for this run"));
|
|
13519
13182
|
return;
|
|
13520
13183
|
}
|
|
13521
|
-
const framework = firstResponse.framework;
|
|
13522
13184
|
let allEvents;
|
|
13523
13185
|
if (!firstResponse.hasMore || options.targetCount !== "all" && firstResponse.events.length >= options.targetCount) {
|
|
13524
13186
|
allEvents = options.targetCount === "all" ? firstResponse.events : firstResponse.events.slice(0, options.targetCount);
|
|
@@ -13546,9 +13208,9 @@ async function showAgentEvents(runId, options, platformUrl) {
|
|
|
13546
13208
|
const events = options.order === "desc" ? [...allEvents].reverse() : allEvents;
|
|
13547
13209
|
const renderer = createLogRenderer(true);
|
|
13548
13210
|
for (const event of events) {
|
|
13549
|
-
renderAgentEvent(event,
|
|
13211
|
+
renderAgentEvent(event, renderer);
|
|
13550
13212
|
}
|
|
13551
|
-
console.log(
|
|
13213
|
+
console.log(chalk36.dim(`View on platform: ${platformUrl}`));
|
|
13552
13214
|
}
|
|
13553
13215
|
async function showSystemLog(runId, options) {
|
|
13554
13216
|
const limit = options.targetCount === "all" ? PAGE_LIMIT : Math.min(options.targetCount, PAGE_LIMIT);
|
|
@@ -13558,7 +13220,7 @@ async function showSystemLog(runId, options) {
|
|
|
13558
13220
|
order: options.order
|
|
13559
13221
|
});
|
|
13560
13222
|
if (!response.systemLog) {
|
|
13561
|
-
console.log(
|
|
13223
|
+
console.log(chalk36.yellow("No system log found for this run"));
|
|
13562
13224
|
return;
|
|
13563
13225
|
}
|
|
13564
13226
|
console.log(response.systemLog);
|
|
@@ -13570,7 +13232,7 @@ async function showMetrics(runId, options) {
|
|
|
13570
13232
|
order: options.order
|
|
13571
13233
|
});
|
|
13572
13234
|
if (firstResponse.metrics.length === 0) {
|
|
13573
|
-
console.log(
|
|
13235
|
+
console.log(chalk36.yellow("No metrics found for this run"));
|
|
13574
13236
|
return;
|
|
13575
13237
|
}
|
|
13576
13238
|
let allMetrics;
|
|
@@ -13610,7 +13272,7 @@ async function showNetworkLogs(runId, options) {
|
|
|
13610
13272
|
});
|
|
13611
13273
|
if (firstResponse.networkLogs.length === 0) {
|
|
13612
13274
|
console.log(
|
|
13613
|
-
|
|
13275
|
+
chalk36.yellow(
|
|
13614
13276
|
"No network logs found for this run. Network logs are only captured when using a runner with proxy enabled"
|
|
13615
13277
|
)
|
|
13616
13278
|
);
|
|
@@ -13651,13 +13313,13 @@ import { Command as Command49 } from "commander";
|
|
|
13651
13313
|
|
|
13652
13314
|
// src/commands/org/status.ts
|
|
13653
13315
|
import { Command as Command41 } from "commander";
|
|
13654
|
-
import
|
|
13316
|
+
import chalk37 from "chalk";
|
|
13655
13317
|
var statusCommand5 = new Command41().name("status").description("View current organization status").action(
|
|
13656
13318
|
withErrorHandler(async () => {
|
|
13657
13319
|
try {
|
|
13658
13320
|
const org = await getOrg();
|
|
13659
|
-
console.log(
|
|
13660
|
-
console.log(` Slug: ${
|
|
13321
|
+
console.log(chalk37.bold("Organization Information:"));
|
|
13322
|
+
console.log(` Slug: ${chalk37.green(org.slug)}`);
|
|
13661
13323
|
} catch (error) {
|
|
13662
13324
|
if (error instanceof Error && error.message.includes("No org configured")) {
|
|
13663
13325
|
throw new Error("No organization configured", {
|
|
@@ -13671,7 +13333,7 @@ var statusCommand5 = new Command41().name("status").description("View current or
|
|
|
13671
13333
|
|
|
13672
13334
|
// src/commands/org/set.ts
|
|
13673
13335
|
import { Command as Command42 } from "commander";
|
|
13674
|
-
import
|
|
13336
|
+
import chalk38 from "chalk";
|
|
13675
13337
|
var setCommand = new Command42().name("set").description("Rename your organization slug").argument("<slug>", "The new organization slug").option(
|
|
13676
13338
|
"--force",
|
|
13677
13339
|
"Force change existing organization (may break references)"
|
|
@@ -13689,10 +13351,10 @@ var setCommand = new Command42().name("set").description("Rename your organizati
|
|
|
13689
13351
|
}
|
|
13690
13352
|
const org = await updateOrg({ slug, force: true });
|
|
13691
13353
|
await saveConfig({ activeOrg: org.slug });
|
|
13692
|
-
console.log(
|
|
13354
|
+
console.log(chalk38.green(`\u2713 Organization updated to ${org.slug}`));
|
|
13693
13355
|
console.log();
|
|
13694
13356
|
console.log("Your agents will now be namespaced as:");
|
|
13695
|
-
console.log(
|
|
13357
|
+
console.log(chalk38.cyan(` ${org.slug}/<agent-name>`));
|
|
13696
13358
|
} catch (error) {
|
|
13697
13359
|
if (error instanceof Error && error.message.includes("already exists")) {
|
|
13698
13360
|
throw new Error(
|
|
@@ -13706,17 +13368,17 @@ var setCommand = new Command42().name("set").description("Rename your organizati
|
|
|
13706
13368
|
|
|
13707
13369
|
// src/commands/org/list.ts
|
|
13708
13370
|
import { Command as Command43 } from "commander";
|
|
13709
|
-
import
|
|
13371
|
+
import chalk39 from "chalk";
|
|
13710
13372
|
var listCommand5 = new Command43().name("list").description("List all accessible organizations").action(
|
|
13711
13373
|
withErrorHandler(async () => {
|
|
13712
13374
|
const result = await listOrgs();
|
|
13713
13375
|
const activeOrg = await getActiveOrg();
|
|
13714
|
-
console.log(
|
|
13376
|
+
console.log(chalk39.bold("Available organizations:"));
|
|
13715
13377
|
for (const org of result.orgs) {
|
|
13716
13378
|
const isCurrent = org.slug === activeOrg;
|
|
13717
|
-
const marker = isCurrent ?
|
|
13379
|
+
const marker = isCurrent ? chalk39.green("* ") : " ";
|
|
13718
13380
|
const roleLabel = org.role ? ` (${org.role})` : "";
|
|
13719
|
-
const currentLabel = isCurrent ?
|
|
13381
|
+
const currentLabel = isCurrent ? chalk39.dim(" \u2190 current") : "";
|
|
13720
13382
|
console.log(`${marker}${org.slug}${roleLabel}${currentLabel}`);
|
|
13721
13383
|
}
|
|
13722
13384
|
})
|
|
@@ -13724,13 +13386,13 @@ var listCommand5 = new Command43().name("list").description("List all accessible
|
|
|
13724
13386
|
|
|
13725
13387
|
// src/commands/org/use.ts
|
|
13726
13388
|
import { Command as Command44 } from "commander";
|
|
13727
|
-
import
|
|
13389
|
+
import chalk40 from "chalk";
|
|
13728
13390
|
var useCommand = new Command44().name("use").description("Switch to a different organization").argument("[slug]", "Organization slug to switch to").option("--personal", "Switch to personal org").action(
|
|
13729
13391
|
withErrorHandler(
|
|
13730
13392
|
async (slug, options) => {
|
|
13731
13393
|
if (options.personal) {
|
|
13732
13394
|
await saveConfig({ activeOrg: void 0 });
|
|
13733
|
-
console.log(
|
|
13395
|
+
console.log(chalk40.green("\u2713 Switched to personal org."));
|
|
13734
13396
|
return;
|
|
13735
13397
|
}
|
|
13736
13398
|
if (!slug) {
|
|
@@ -13746,27 +13408,27 @@ var useCommand = new Command44().name("use").description("Switch to a different
|
|
|
13746
13408
|
);
|
|
13747
13409
|
}
|
|
13748
13410
|
await saveConfig({ activeOrg: slug });
|
|
13749
|
-
console.log(
|
|
13411
|
+
console.log(chalk40.green(`\u2713 Switched to organization: ${slug}`));
|
|
13750
13412
|
}
|
|
13751
13413
|
)
|
|
13752
13414
|
);
|
|
13753
13415
|
|
|
13754
13416
|
// src/commands/org/members.ts
|
|
13755
13417
|
import { Command as Command45 } from "commander";
|
|
13756
|
-
import
|
|
13418
|
+
import chalk41 from "chalk";
|
|
13757
13419
|
var membersCommand = new Command45().name("members").description("View organization members").action(
|
|
13758
13420
|
withErrorHandler(async () => {
|
|
13759
13421
|
try {
|
|
13760
13422
|
const status = await getOrgMembers();
|
|
13761
|
-
console.log(
|
|
13423
|
+
console.log(chalk41.bold(`Organization: ${status.slug}`));
|
|
13762
13424
|
console.log(` Role: ${status.role}`);
|
|
13763
13425
|
console.log(
|
|
13764
13426
|
` Created: ${new Date(status.createdAt).toLocaleDateString()}`
|
|
13765
13427
|
);
|
|
13766
13428
|
console.log();
|
|
13767
|
-
console.log(
|
|
13429
|
+
console.log(chalk41.bold("Members:"));
|
|
13768
13430
|
for (const member of status.members) {
|
|
13769
|
-
const roleTag = member.role === "admin" ?
|
|
13431
|
+
const roleTag = member.role === "admin" ? chalk41.yellow(` (${member.role})`) : chalk41.dim(` (${member.role})`);
|
|
13770
13432
|
console.log(` ${member.email}${roleTag}`);
|
|
13771
13433
|
}
|
|
13772
13434
|
} catch (error) {
|
|
@@ -13782,33 +13444,33 @@ var membersCommand = new Command45().name("members").description("View organizat
|
|
|
13782
13444
|
|
|
13783
13445
|
// src/commands/org/invite.ts
|
|
13784
13446
|
import { Command as Command46 } from "commander";
|
|
13785
|
-
import
|
|
13447
|
+
import chalk42 from "chalk";
|
|
13786
13448
|
var inviteCommand = new Command46().name("invite").description("Invite a member to the current organization").requiredOption("--email <email>", "Email address of the member to invite").action(
|
|
13787
13449
|
withErrorHandler(async (options) => {
|
|
13788
13450
|
await inviteOrgMember(options.email);
|
|
13789
|
-
console.log(
|
|
13451
|
+
console.log(chalk42.green(`\u2713 Invitation sent to ${options.email}`));
|
|
13790
13452
|
})
|
|
13791
13453
|
);
|
|
13792
13454
|
|
|
13793
13455
|
// src/commands/org/remove.ts
|
|
13794
13456
|
import { Command as Command47 } from "commander";
|
|
13795
|
-
import
|
|
13457
|
+
import chalk43 from "chalk";
|
|
13796
13458
|
var removeCommand = new Command47().name("remove").description("Remove a member from the current organization").argument("<email>", "Email address of the member to remove").action(
|
|
13797
13459
|
withErrorHandler(async (email) => {
|
|
13798
13460
|
await removeOrgMember(email);
|
|
13799
|
-
console.log(
|
|
13461
|
+
console.log(chalk43.green(`\u2713 Removed ${email} from organization`));
|
|
13800
13462
|
})
|
|
13801
13463
|
);
|
|
13802
13464
|
|
|
13803
13465
|
// src/commands/org/leave.ts
|
|
13804
13466
|
import { Command as Command48 } from "commander";
|
|
13805
|
-
import
|
|
13467
|
+
import chalk44 from "chalk";
|
|
13806
13468
|
var leaveCommand = new Command48().name("leave").description("Leave the current organization").action(
|
|
13807
13469
|
withErrorHandler(async () => {
|
|
13808
13470
|
await leaveOrg();
|
|
13809
13471
|
await saveConfig({ activeOrg: void 0 });
|
|
13810
13472
|
console.log(
|
|
13811
|
-
|
|
13473
|
+
chalk44.green("\u2713 Left organization. Switched to personal org.")
|
|
13812
13474
|
);
|
|
13813
13475
|
})
|
|
13814
13476
|
);
|
|
@@ -13821,7 +13483,7 @@ import { Command as Command54 } from "commander";
|
|
|
13821
13483
|
|
|
13822
13484
|
// src/commands/agent/clone.ts
|
|
13823
13485
|
import { Command as Command50 } from "commander";
|
|
13824
|
-
import
|
|
13486
|
+
import chalk45 from "chalk";
|
|
13825
13487
|
import { mkdtempSync as mkdtempSync5 } from "fs";
|
|
13826
13488
|
import { mkdir as mkdir7, writeFile as writeFile6, readdir as readdir2, copyFile, rm as rm4 } from "fs/promises";
|
|
13827
13489
|
import { join as join10, dirname as dirname3, resolve, sep } from "path";
|
|
@@ -13852,13 +13514,13 @@ async function downloadInstructions(agentName, instructionsPath, destination) {
|
|
|
13852
13514
|
throw new Error("Invalid instructions path: path traversal detected");
|
|
13853
13515
|
}
|
|
13854
13516
|
const volumeName = getInstructionsStorageName(agentName);
|
|
13855
|
-
console.log(
|
|
13517
|
+
console.log(chalk45.dim("Downloading instructions..."));
|
|
13856
13518
|
const downloadInfo = await getStorageDownload({
|
|
13857
13519
|
name: volumeName,
|
|
13858
13520
|
type: "volume"
|
|
13859
13521
|
});
|
|
13860
13522
|
if ("empty" in downloadInfo) {
|
|
13861
|
-
console.log(
|
|
13523
|
+
console.log(chalk45.yellow("\u26A0 Instructions volume is empty"));
|
|
13862
13524
|
return false;
|
|
13863
13525
|
}
|
|
13864
13526
|
const response = await fetch(downloadInfo.url);
|
|
@@ -13873,7 +13535,7 @@ async function downloadInstructions(agentName, instructionsPath, destination) {
|
|
|
13873
13535
|
const files = await readdir2(tmpDir);
|
|
13874
13536
|
const mdFile = files.find((f) => f === "CLAUDE.md" || f === "AGENTS.md");
|
|
13875
13537
|
if (!mdFile) {
|
|
13876
|
-
console.log(
|
|
13538
|
+
console.log(chalk45.yellow("\u26A0 No instructions file found in volume"));
|
|
13877
13539
|
await rm4(tmpDir, { recursive: true, force: true });
|
|
13878
13540
|
return false;
|
|
13879
13541
|
}
|
|
@@ -13903,7 +13565,7 @@ var cloneCommand4 = new Command50().name("clone").description("Clone agent compo
|
|
|
13903
13565
|
await mkdir7(targetDir, { recursive: true });
|
|
13904
13566
|
const yamlPath = join10(targetDir, "vm0.yaml");
|
|
13905
13567
|
await writeFile6(yamlPath, yamlContent, "utf8");
|
|
13906
|
-
console.log(
|
|
13568
|
+
console.log(chalk45.green("\u2713 Created vm0.yaml"));
|
|
13907
13569
|
const agentKey = Object.keys(content.agents)[0];
|
|
13908
13570
|
const agent = agentKey ? content.agents[agentKey] : void 0;
|
|
13909
13571
|
if (agent?.instructions) {
|
|
@@ -13914,26 +13576,26 @@ var cloneCommand4 = new Command50().name("clone").description("Clone agent compo
|
|
|
13914
13576
|
targetDir
|
|
13915
13577
|
);
|
|
13916
13578
|
if (instructionsDownloaded) {
|
|
13917
|
-
console.log(
|
|
13579
|
+
console.log(chalk45.green(`\u2713 Downloaded ${agent.instructions}`));
|
|
13918
13580
|
}
|
|
13919
13581
|
} catch (error) {
|
|
13920
13582
|
console.log(
|
|
13921
|
-
|
|
13583
|
+
chalk45.yellow(
|
|
13922
13584
|
`\u26A0 Could not download instructions: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
13923
13585
|
)
|
|
13924
13586
|
);
|
|
13925
13587
|
}
|
|
13926
13588
|
}
|
|
13927
13589
|
console.log();
|
|
13928
|
-
console.log(
|
|
13929
|
-
console.log(
|
|
13930
|
-
console.log(
|
|
13590
|
+
console.log(chalk45.green(`\u2713 Successfully cloned agent: ${name}`));
|
|
13591
|
+
console.log(chalk45.dim(` Location: ${targetDir}/`));
|
|
13592
|
+
console.log(chalk45.dim(` Version: ${compose.headVersionId.slice(0, 8)}`));
|
|
13931
13593
|
})
|
|
13932
13594
|
);
|
|
13933
13595
|
|
|
13934
13596
|
// src/commands/agent/delete.ts
|
|
13935
13597
|
import { Command as Command51 } from "commander";
|
|
13936
|
-
import
|
|
13598
|
+
import chalk46 from "chalk";
|
|
13937
13599
|
var deleteCommand = new Command51().name("delete").alias("rm").description("Delete an agent").argument("<name>", "Agent name to delete").option("-y, --yes", "Skip confirmation prompt").action(
|
|
13938
13600
|
withErrorHandler(async (name, options) => {
|
|
13939
13601
|
const compose = await getComposeByName(name);
|
|
@@ -13948,7 +13610,7 @@ var deleteCommand = new Command51().name("delete").alias("rm").description("Dele
|
|
|
13948
13610
|
}
|
|
13949
13611
|
const confirmed = await promptConfirm(`Delete agent '${name}'?`, false);
|
|
13950
13612
|
if (!confirmed) {
|
|
13951
|
-
console.log(
|
|
13613
|
+
console.log(chalk46.dim("Cancelled"));
|
|
13952
13614
|
return;
|
|
13953
13615
|
}
|
|
13954
13616
|
}
|
|
@@ -13962,13 +13624,13 @@ var deleteCommand = new Command51().name("delete").alias("rm").description("Dele
|
|
|
13962
13624
|
}
|
|
13963
13625
|
throw error;
|
|
13964
13626
|
}
|
|
13965
|
-
console.log(
|
|
13627
|
+
console.log(chalk46.green(`\u2713 Agent '${name}' deleted`));
|
|
13966
13628
|
})
|
|
13967
13629
|
);
|
|
13968
13630
|
|
|
13969
13631
|
// src/commands/agent/list.ts
|
|
13970
13632
|
import { Command as Command52 } from "commander";
|
|
13971
|
-
import
|
|
13633
|
+
import chalk47 from "chalk";
|
|
13972
13634
|
var listCommand6 = new Command52().name("list").alias("ls").description("List all agent composes").action(
|
|
13973
13635
|
withErrorHandler(async () => {
|
|
13974
13636
|
const response = await httpGet("/api/agent/composes/list");
|
|
@@ -13978,9 +13640,9 @@ var listCommand6 = new Command52().name("list").alias("ls").description("List al
|
|
|
13978
13640
|
}
|
|
13979
13641
|
const data = await response.json();
|
|
13980
13642
|
if (data.composes.length === 0) {
|
|
13981
|
-
console.log(
|
|
13643
|
+
console.log(chalk47.dim("No agent composes found"));
|
|
13982
13644
|
console.log(
|
|
13983
|
-
|
|
13645
|
+
chalk47.dim(" Create one with: vm0 compose <agent-compose.yaml>")
|
|
13984
13646
|
);
|
|
13985
13647
|
return;
|
|
13986
13648
|
}
|
|
@@ -13988,9 +13650,9 @@ var listCommand6 = new Command52().name("list").alias("ls").description("List al
|
|
|
13988
13650
|
const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
|
|
13989
13651
|
" "
|
|
13990
13652
|
);
|
|
13991
|
-
console.log(
|
|
13653
|
+
console.log(chalk47.dim(header));
|
|
13992
13654
|
for (const compose of data.composes) {
|
|
13993
|
-
const versionShort = compose.headVersionId ? compose.headVersionId.slice(0, 8) :
|
|
13655
|
+
const versionShort = compose.headVersionId ? compose.headVersionId.slice(0, 8) : chalk47.dim("-");
|
|
13994
13656
|
const row = [
|
|
13995
13657
|
compose.name.padEnd(nameWidth),
|
|
13996
13658
|
versionShort,
|
|
@@ -14003,7 +13665,7 @@ var listCommand6 = new Command52().name("list").alias("ls").description("List al
|
|
|
14003
13665
|
|
|
14004
13666
|
// src/commands/agent/status.ts
|
|
14005
13667
|
import { Command as Command53 } from "commander";
|
|
14006
|
-
import
|
|
13668
|
+
import chalk48 from "chalk";
|
|
14007
13669
|
|
|
14008
13670
|
// src/lib/domain/source-derivation.ts
|
|
14009
13671
|
import * as fs10 from "fs/promises";
|
|
@@ -14117,20 +13779,20 @@ function formatVariableSources(sources) {
|
|
|
14117
13779
|
if (sources.secrets.length > 0) {
|
|
14118
13780
|
console.log(` Secrets:`);
|
|
14119
13781
|
for (const secret of sources.secrets) {
|
|
14120
|
-
const sourceInfo =
|
|
13782
|
+
const sourceInfo = chalk48.dim(`(${secret.source})`);
|
|
14121
13783
|
console.log(` - ${secret.name.padEnd(20)} ${sourceInfo}`);
|
|
14122
13784
|
}
|
|
14123
13785
|
}
|
|
14124
13786
|
if (sources.vars.length > 0) {
|
|
14125
13787
|
console.log(` Vars:`);
|
|
14126
13788
|
for (const v of sources.vars) {
|
|
14127
|
-
const sourceInfo =
|
|
13789
|
+
const sourceInfo = chalk48.dim(`(${v.source})`);
|
|
14128
13790
|
console.log(` - ${v.name.padEnd(20)} ${sourceInfo}`);
|
|
14129
13791
|
}
|
|
14130
13792
|
}
|
|
14131
13793
|
}
|
|
14132
13794
|
function formatAgentDetails(agentName, agent, agentSources, volumeConfigs) {
|
|
14133
|
-
console.log(` ${
|
|
13795
|
+
console.log(` ${chalk48.cyan(agentName)}:`);
|
|
14134
13796
|
console.log(` Framework: ${agent.framework}`);
|
|
14135
13797
|
if (agent.image) {
|
|
14136
13798
|
console.log(` Image: ${agent.image}`);
|
|
@@ -14148,10 +13810,10 @@ function formatAgentDetails(agentName, agent, agentSources, volumeConfigs) {
|
|
|
14148
13810
|
}
|
|
14149
13811
|
}
|
|
14150
13812
|
function formatComposeOutput(name, versionId, content, variableSources) {
|
|
14151
|
-
console.log(
|
|
14152
|
-
console.log(
|
|
13813
|
+
console.log(chalk48.bold("Name:") + ` ${name}`);
|
|
13814
|
+
console.log(chalk48.bold("Version:") + ` ${versionId}`);
|
|
14153
13815
|
console.log();
|
|
14154
|
-
console.log(
|
|
13816
|
+
console.log(chalk48.bold("Agents:"));
|
|
14155
13817
|
for (const [agentName, agent] of Object.entries(content.agents)) {
|
|
14156
13818
|
const agentSources = variableSources?.get(agentName);
|
|
14157
13819
|
formatAgentDetails(agentName, agent, agentSources, content.volumes);
|
|
@@ -14210,7 +13872,7 @@ var statusCommand6 = new Command53().name("status").description("Show status of
|
|
|
14210
13872
|
});
|
|
14211
13873
|
} catch {
|
|
14212
13874
|
console.error(
|
|
14213
|
-
|
|
13875
|
+
chalk48.yellow(
|
|
14214
13876
|
"\u26A0 Warning: Failed to fetch skill sources, showing basic info"
|
|
14215
13877
|
)
|
|
14216
13878
|
);
|
|
@@ -14230,7 +13892,7 @@ var agentCommand = new Command54().name("agent").description("Manage agent compo
|
|
|
14230
13892
|
|
|
14231
13893
|
// src/commands/init/index.ts
|
|
14232
13894
|
import { Command as Command55 } from "commander";
|
|
14233
|
-
import
|
|
13895
|
+
import chalk49 from "chalk";
|
|
14234
13896
|
import path17 from "path";
|
|
14235
13897
|
import { existsSync as existsSync11 } from "fs";
|
|
14236
13898
|
import { writeFile as writeFile7 } from "fs/promises";
|
|
@@ -14297,7 +13959,7 @@ var initCommand4 = new Command55().name("init").description("Initialize a new VM
|
|
|
14297
13959
|
}
|
|
14298
13960
|
);
|
|
14299
13961
|
if (name === void 0) {
|
|
14300
|
-
console.log(
|
|
13962
|
+
console.log(chalk49.dim("Cancelled"));
|
|
14301
13963
|
return;
|
|
14302
13964
|
}
|
|
14303
13965
|
agentName = name;
|
|
@@ -14311,23 +13973,23 @@ var initCommand4 = new Command55().name("init").description("Initialize a new VM
|
|
|
14311
13973
|
}
|
|
14312
13974
|
await writeFile7(VM0_YAML_FILE, generateVm0Yaml(agentName));
|
|
14313
13975
|
const vm0Status = existingFiles.includes(VM0_YAML_FILE) ? " (overwritten)" : "";
|
|
14314
|
-
console.log(
|
|
13976
|
+
console.log(chalk49.green(`\u2713 Created ${VM0_YAML_FILE}${vm0Status}`));
|
|
14315
13977
|
await writeFile7(AGENTS_MD_FILE, generateAgentsMd());
|
|
14316
13978
|
const agentsStatus = existingFiles.includes(AGENTS_MD_FILE) ? " (overwritten)" : "";
|
|
14317
|
-
console.log(
|
|
13979
|
+
console.log(chalk49.green(`\u2713 Created ${AGENTS_MD_FILE}${agentsStatus}`));
|
|
14318
13980
|
console.log();
|
|
14319
13981
|
console.log("Next steps:");
|
|
14320
13982
|
console.log(
|
|
14321
|
-
` 1. Set up model provider (one-time): ${
|
|
13983
|
+
` 1. Set up model provider (one-time): ${chalk49.cyan("vm0 model-provider setup")}`
|
|
14322
13984
|
);
|
|
14323
13985
|
console.log(
|
|
14324
|
-
` 2. Edit ${
|
|
13986
|
+
` 2. Edit ${chalk49.cyan("AGENTS.md")} to customize your agent's workflow`
|
|
14325
13987
|
);
|
|
14326
13988
|
console.log(
|
|
14327
|
-
` Or install Claude plugin: ${
|
|
13989
|
+
` Or install Claude plugin: ${chalk49.cyan(`vm0 setup-claude && claude "/vm0-agent let's build an agent"`)}`
|
|
14328
13990
|
);
|
|
14329
13991
|
console.log(
|
|
14330
|
-
` 3. Run your agent: ${
|
|
13992
|
+
` 3. Run your agent: ${chalk49.cyan(`vm0 cook "let's start working"`)}`
|
|
14331
13993
|
);
|
|
14332
13994
|
})
|
|
14333
13995
|
);
|
|
@@ -14337,7 +13999,7 @@ import { Command as Command62 } from "commander";
|
|
|
14337
13999
|
|
|
14338
14000
|
// src/commands/schedule/setup.ts
|
|
14339
14001
|
import { Command as Command56 } from "commander";
|
|
14340
|
-
import
|
|
14002
|
+
import chalk50 from "chalk";
|
|
14341
14003
|
|
|
14342
14004
|
// src/lib/domain/schedule-utils.ts
|
|
14343
14005
|
import { parse as parseYaml6 } from "yaml";
|
|
@@ -14827,7 +14489,7 @@ async function buildAndDeploy(params) {
|
|
|
14827
14489
|
}
|
|
14828
14490
|
console.log(
|
|
14829
14491
|
`
|
|
14830
|
-
Deploying schedule for agent ${
|
|
14492
|
+
Deploying schedule for agent ${chalk50.cyan(params.agentName)}...`
|
|
14831
14493
|
);
|
|
14832
14494
|
const deployResult = await deploySchedule({
|
|
14833
14495
|
name: params.scheduleName,
|
|
@@ -14850,62 +14512,62 @@ Deploying schedule for agent ${chalk51.cyan(params.agentName)}...`
|
|
|
14850
14512
|
function displayDeployResult(agentName, deployResult) {
|
|
14851
14513
|
if (deployResult.created) {
|
|
14852
14514
|
console.log(
|
|
14853
|
-
|
|
14515
|
+
chalk50.green(`\u2713 Created schedule for agent ${chalk50.cyan(agentName)}`)
|
|
14854
14516
|
);
|
|
14855
14517
|
} else {
|
|
14856
14518
|
console.log(
|
|
14857
|
-
|
|
14519
|
+
chalk50.green(`\u2713 Updated schedule for agent ${chalk50.cyan(agentName)}`)
|
|
14858
14520
|
);
|
|
14859
14521
|
}
|
|
14860
|
-
console.log(
|
|
14522
|
+
console.log(chalk50.dim(` Timezone: ${deployResult.schedule.timezone}`));
|
|
14861
14523
|
if (deployResult.schedule.triggerType === "loop" && deployResult.schedule.intervalSeconds != null) {
|
|
14862
14524
|
console.log(
|
|
14863
|
-
|
|
14525
|
+
chalk50.dim(
|
|
14864
14526
|
` Mode: Loop (interval ${deployResult.schedule.intervalSeconds}s)`
|
|
14865
14527
|
)
|
|
14866
14528
|
);
|
|
14867
14529
|
} else if (deployResult.schedule.cronExpression) {
|
|
14868
|
-
console.log(
|
|
14530
|
+
console.log(chalk50.dim(` Cron: ${deployResult.schedule.cronExpression}`));
|
|
14869
14531
|
if (deployResult.schedule.nextRunAt) {
|
|
14870
14532
|
const nextRun = formatInTimezone(
|
|
14871
14533
|
deployResult.schedule.nextRunAt,
|
|
14872
14534
|
deployResult.schedule.timezone
|
|
14873
14535
|
);
|
|
14874
|
-
console.log(
|
|
14536
|
+
console.log(chalk50.dim(` Next run: ${nextRun}`));
|
|
14875
14537
|
}
|
|
14876
14538
|
} else if (deployResult.schedule.atTime) {
|
|
14877
14539
|
const atTimeFormatted = formatInTimezone(
|
|
14878
14540
|
deployResult.schedule.atTime,
|
|
14879
14541
|
deployResult.schedule.timezone
|
|
14880
14542
|
);
|
|
14881
|
-
console.log(
|
|
14543
|
+
console.log(chalk50.dim(` At: ${atTimeFormatted}`));
|
|
14882
14544
|
}
|
|
14883
14545
|
}
|
|
14884
14546
|
async function tryEnableSchedule(scheduleName, composeId, agentName) {
|
|
14885
14547
|
try {
|
|
14886
14548
|
await enableSchedule({ name: scheduleName, composeId });
|
|
14887
14549
|
console.log(
|
|
14888
|
-
|
|
14550
|
+
chalk50.green(`\u2713 Enabled schedule for agent ${chalk50.cyan(agentName)}`)
|
|
14889
14551
|
);
|
|
14890
14552
|
} catch (error) {
|
|
14891
|
-
console.error(
|
|
14553
|
+
console.error(chalk50.yellow("\u26A0 Failed to enable schedule"));
|
|
14892
14554
|
if (error instanceof ApiRequestError) {
|
|
14893
14555
|
if (error.code === "SCHEDULE_PAST") {
|
|
14894
|
-
console.error(
|
|
14556
|
+
console.error(chalk50.dim(" Scheduled time has already passed"));
|
|
14895
14557
|
} else {
|
|
14896
|
-
console.error(
|
|
14558
|
+
console.error(chalk50.dim(` ${error.message}`));
|
|
14897
14559
|
}
|
|
14898
14560
|
} else if (error instanceof Error) {
|
|
14899
|
-
console.error(
|
|
14561
|
+
console.error(chalk50.dim(` ${error.message}`));
|
|
14900
14562
|
}
|
|
14901
14563
|
console.log(
|
|
14902
|
-
` To enable manually: ${
|
|
14564
|
+
` To enable manually: ${chalk50.cyan(`vm0 schedule enable ${agentName}`)}`
|
|
14903
14565
|
);
|
|
14904
14566
|
}
|
|
14905
14567
|
}
|
|
14906
14568
|
function showEnableHint(agentName) {
|
|
14907
14569
|
console.log();
|
|
14908
|
-
console.log(` To enable: ${
|
|
14570
|
+
console.log(` To enable: ${chalk50.cyan(`vm0 schedule enable ${agentName}`)}`);
|
|
14909
14571
|
}
|
|
14910
14572
|
async function handleScheduleEnabling(params) {
|
|
14911
14573
|
const { scheduleName, composeId, agentName, enableFlag, shouldPromptEnable } = params;
|
|
@@ -14937,7 +14599,7 @@ var setupCommand = new Command56().name("setup").description("Create or edit a s
|
|
|
14937
14599
|
scheduleName
|
|
14938
14600
|
);
|
|
14939
14601
|
console.log(
|
|
14940
|
-
|
|
14602
|
+
chalk50.dim(
|
|
14941
14603
|
existingSchedule ? `Editing existing schedule for agent ${agentName}` : `Creating new schedule for agent ${agentName}`
|
|
14942
14604
|
)
|
|
14943
14605
|
);
|
|
@@ -14947,12 +14609,12 @@ var setupCommand = new Command56().name("setup").description("Create or edit a s
|
|
|
14947
14609
|
defaults.frequency
|
|
14948
14610
|
);
|
|
14949
14611
|
if (!frequency) {
|
|
14950
|
-
console.log(
|
|
14612
|
+
console.log(chalk50.dim("Cancelled"));
|
|
14951
14613
|
return;
|
|
14952
14614
|
}
|
|
14953
14615
|
const timing = await gatherTiming(frequency, options, defaults);
|
|
14954
14616
|
if (!timing) {
|
|
14955
|
-
console.log(
|
|
14617
|
+
console.log(chalk50.dim("Cancelled"));
|
|
14956
14618
|
return;
|
|
14957
14619
|
}
|
|
14958
14620
|
const { day, time, atTime, intervalSeconds } = timing;
|
|
@@ -14961,7 +14623,7 @@ var setupCommand = new Command56().name("setup").description("Create or edit a s
|
|
|
14961
14623
|
existingSchedule?.timezone
|
|
14962
14624
|
);
|
|
14963
14625
|
if (!timezone) {
|
|
14964
|
-
console.log(
|
|
14626
|
+
console.log(chalk50.dim("Cancelled"));
|
|
14965
14627
|
return;
|
|
14966
14628
|
}
|
|
14967
14629
|
const promptText_ = await gatherPromptText(
|
|
@@ -14969,7 +14631,7 @@ var setupCommand = new Command56().name("setup").description("Create or edit a s
|
|
|
14969
14631
|
existingSchedule?.prompt
|
|
14970
14632
|
);
|
|
14971
14633
|
if (!promptText_) {
|
|
14972
|
-
console.log(
|
|
14634
|
+
console.log(chalk50.dim("Cancelled"));
|
|
14973
14635
|
return;
|
|
14974
14636
|
}
|
|
14975
14637
|
const { notifyEmail, notifySlack } = await gatherNotificationPreferences(
|
|
@@ -15006,14 +14668,14 @@ var setupCommand = new Command56().name("setup").description("Create or edit a s
|
|
|
15006
14668
|
|
|
15007
14669
|
// src/commands/schedule/list.ts
|
|
15008
14670
|
import { Command as Command57 } from "commander";
|
|
15009
|
-
import
|
|
14671
|
+
import chalk51 from "chalk";
|
|
15010
14672
|
var listCommand7 = new Command57().name("list").alias("ls").description("List all schedules").action(
|
|
15011
14673
|
withErrorHandler(async () => {
|
|
15012
14674
|
const result = await listSchedules();
|
|
15013
14675
|
if (result.schedules.length === 0) {
|
|
15014
|
-
console.log(
|
|
14676
|
+
console.log(chalk51.dim("No schedules found"));
|
|
15015
14677
|
console.log(
|
|
15016
|
-
|
|
14678
|
+
chalk51.dim(" Create one with: vm0 schedule setup <agent-name>")
|
|
15017
14679
|
);
|
|
15018
14680
|
return;
|
|
15019
14681
|
}
|
|
@@ -15038,10 +14700,10 @@ var listCommand7 = new Command57().name("list").alias("ls").description("List al
|
|
|
15038
14700
|
"STATUS".padEnd(8),
|
|
15039
14701
|
"NEXT RUN"
|
|
15040
14702
|
].join(" ");
|
|
15041
|
-
console.log(
|
|
14703
|
+
console.log(chalk51.dim(header));
|
|
15042
14704
|
for (const schedule of result.schedules) {
|
|
15043
14705
|
const trigger = schedule.cronExpression ? `${schedule.cronExpression} (${schedule.timezone})` : schedule.atTime || "-";
|
|
15044
|
-
const status = schedule.enabled ?
|
|
14706
|
+
const status = schedule.enabled ? chalk51.green("enabled") : chalk51.yellow("disabled");
|
|
15045
14707
|
const nextRun = schedule.enabled ? formatRelativeTime2(schedule.nextRunAt) : "-";
|
|
15046
14708
|
const row = [
|
|
15047
14709
|
schedule.composeName.padEnd(agentWidth),
|
|
@@ -15058,47 +14720,47 @@ var listCommand7 = new Command57().name("list").alias("ls").description("List al
|
|
|
15058
14720
|
|
|
15059
14721
|
// src/commands/schedule/status.ts
|
|
15060
14722
|
import { Command as Command58 } from "commander";
|
|
15061
|
-
import
|
|
14723
|
+
import chalk52 from "chalk";
|
|
15062
14724
|
function formatDateTimeStyled(dateStr) {
|
|
15063
|
-
if (!dateStr) return
|
|
14725
|
+
if (!dateStr) return chalk52.dim("-");
|
|
15064
14726
|
const formatted = formatDateTime(dateStr);
|
|
15065
|
-
return formatted.replace(/\(([^)]+)\)$/,
|
|
14727
|
+
return formatted.replace(/\(([^)]+)\)$/, chalk52.dim("($1)"));
|
|
15066
14728
|
}
|
|
15067
14729
|
function formatTrigger(schedule) {
|
|
15068
14730
|
if (schedule.triggerType === "loop" && schedule.intervalSeconds !== null) {
|
|
15069
|
-
return `interval ${schedule.intervalSeconds}s ${
|
|
14731
|
+
return `interval ${schedule.intervalSeconds}s ${chalk52.dim("(loop)")}`;
|
|
15070
14732
|
}
|
|
15071
14733
|
if (schedule.cronExpression) {
|
|
15072
14734
|
return schedule.cronExpression;
|
|
15073
14735
|
}
|
|
15074
14736
|
if (schedule.atTime) {
|
|
15075
|
-
return `${schedule.atTime} ${
|
|
14737
|
+
return `${schedule.atTime} ${chalk52.dim("(one-time)")}`;
|
|
15076
14738
|
}
|
|
15077
|
-
return
|
|
14739
|
+
return chalk52.dim("-");
|
|
15078
14740
|
}
|
|
15079
14741
|
function formatRunStatus2(status) {
|
|
15080
14742
|
switch (status) {
|
|
15081
14743
|
case "completed":
|
|
15082
|
-
return
|
|
14744
|
+
return chalk52.green(status);
|
|
15083
14745
|
case "failed":
|
|
15084
14746
|
case "timeout":
|
|
15085
|
-
return
|
|
14747
|
+
return chalk52.red(status);
|
|
15086
14748
|
case "running":
|
|
15087
|
-
return
|
|
14749
|
+
return chalk52.cyan(status);
|
|
15088
14750
|
case "pending":
|
|
15089
|
-
return
|
|
14751
|
+
return chalk52.yellow(status);
|
|
15090
14752
|
default:
|
|
15091
14753
|
return status;
|
|
15092
14754
|
}
|
|
15093
14755
|
}
|
|
15094
14756
|
function printRunConfiguration(schedule) {
|
|
15095
|
-
const statusText = schedule.enabled ?
|
|
14757
|
+
const statusText = schedule.enabled ? chalk52.green("enabled") : chalk52.yellow("disabled");
|
|
15096
14758
|
console.log(`${"Status:".padEnd(16)}${statusText}`);
|
|
15097
14759
|
console.log(
|
|
15098
|
-
`${"Agent:".padEnd(16)}${schedule.composeName} ${
|
|
14760
|
+
`${"Agent:".padEnd(16)}${schedule.composeName} ${chalk52.dim(`(${schedule.orgSlug})`)}`
|
|
15099
14761
|
);
|
|
15100
14762
|
const promptPreview = schedule.prompt.length > 60 ? schedule.prompt.slice(0, 57) + "..." : schedule.prompt;
|
|
15101
|
-
console.log(`${"Prompt:".padEnd(16)}${
|
|
14763
|
+
console.log(`${"Prompt:".padEnd(16)}${chalk52.dim(promptPreview)}`);
|
|
15102
14764
|
if (schedule.vars && Object.keys(schedule.vars).length > 0) {
|
|
15103
14765
|
console.log(
|
|
15104
14766
|
`${"Variables:".padEnd(16)}${Object.keys(schedule.vars).join(", ")}`
|
|
@@ -15127,7 +14789,7 @@ function printTimeSchedule(schedule) {
|
|
|
15127
14789
|
);
|
|
15128
14790
|
}
|
|
15129
14791
|
if (schedule.triggerType === "loop") {
|
|
15130
|
-
const failureText = schedule.consecutiveFailures > 0 ?
|
|
14792
|
+
const failureText = schedule.consecutiveFailures > 0 ? chalk52.yellow(`${schedule.consecutiveFailures}/3`) : chalk52.dim("0/3");
|
|
15131
14793
|
console.log(`${"Failures:".padEnd(16)}${failureText}`);
|
|
15132
14794
|
}
|
|
15133
14795
|
}
|
|
@@ -15143,7 +14805,7 @@ async function printRecentRuns(name, composeId, limit) {
|
|
|
15143
14805
|
console.log();
|
|
15144
14806
|
console.log("Recent Runs:");
|
|
15145
14807
|
console.log(
|
|
15146
|
-
|
|
14808
|
+
chalk52.dim("RUN ID STATUS CREATED")
|
|
15147
14809
|
);
|
|
15148
14810
|
for (const run of runs) {
|
|
15149
14811
|
const id = run.id;
|
|
@@ -15154,7 +14816,7 @@ async function printRecentRuns(name, composeId, limit) {
|
|
|
15154
14816
|
}
|
|
15155
14817
|
} catch {
|
|
15156
14818
|
console.log();
|
|
15157
|
-
console.log(
|
|
14819
|
+
console.log(chalk52.dim("Recent Runs: (unable to fetch)"));
|
|
15158
14820
|
}
|
|
15159
14821
|
}
|
|
15160
14822
|
var statusCommand7 = new Command58().name("status").description("Show detailed status of a schedule").argument("<agent-name>", "Agent name").option(
|
|
@@ -15171,8 +14833,8 @@ var statusCommand7 = new Command58().name("status").description("Show detailed s
|
|
|
15171
14833
|
const { name, composeId } = resolved;
|
|
15172
14834
|
const schedule = await getScheduleByName({ name, composeId });
|
|
15173
14835
|
console.log();
|
|
15174
|
-
console.log(`Schedule for agent: ${
|
|
15175
|
-
console.log(
|
|
14836
|
+
console.log(`Schedule for agent: ${chalk52.cyan(agentName)}`);
|
|
14837
|
+
console.log(chalk52.dim("\u2501".repeat(50)));
|
|
15176
14838
|
printRunConfiguration(schedule);
|
|
15177
14839
|
printTimeSchedule(schedule);
|
|
15178
14840
|
const parsed = parseInt(options.limit, 10);
|
|
@@ -15188,7 +14850,7 @@ var statusCommand7 = new Command58().name("status").description("Show detailed s
|
|
|
15188
14850
|
|
|
15189
14851
|
// src/commands/schedule/delete.ts
|
|
15190
14852
|
import { Command as Command59 } from "commander";
|
|
15191
|
-
import
|
|
14853
|
+
import chalk53 from "chalk";
|
|
15192
14854
|
var deleteCommand2 = new Command59().name("delete").alias("rm").description("Delete a schedule").argument("<agent-name>", "Agent name").option(
|
|
15193
14855
|
"-n, --name <schedule-name>",
|
|
15194
14856
|
"Schedule name (required when agent has multiple schedules)"
|
|
@@ -15201,11 +14863,11 @@ var deleteCommand2 = new Command59().name("delete").alias("rm").description("Del
|
|
|
15201
14863
|
throw new Error("--yes flag is required in non-interactive mode");
|
|
15202
14864
|
}
|
|
15203
14865
|
const confirmed = await promptConfirm(
|
|
15204
|
-
`Delete schedule for agent ${
|
|
14866
|
+
`Delete schedule for agent ${chalk53.cyan(agentName)}?`,
|
|
15205
14867
|
false
|
|
15206
14868
|
);
|
|
15207
14869
|
if (!confirmed) {
|
|
15208
|
-
console.log(
|
|
14870
|
+
console.log(chalk53.dim("Cancelled"));
|
|
15209
14871
|
return;
|
|
15210
14872
|
}
|
|
15211
14873
|
}
|
|
@@ -15214,7 +14876,7 @@ var deleteCommand2 = new Command59().name("delete").alias("rm").description("Del
|
|
|
15214
14876
|
composeId: resolved.composeId
|
|
15215
14877
|
});
|
|
15216
14878
|
console.log(
|
|
15217
|
-
|
|
14879
|
+
chalk53.green(`\u2713 Deleted schedule for agent ${chalk53.cyan(agentName)}`)
|
|
15218
14880
|
);
|
|
15219
14881
|
}
|
|
15220
14882
|
)
|
|
@@ -15222,7 +14884,7 @@ var deleteCommand2 = new Command59().name("delete").alias("rm").description("Del
|
|
|
15222
14884
|
|
|
15223
14885
|
// src/commands/schedule/enable.ts
|
|
15224
14886
|
import { Command as Command60 } from "commander";
|
|
15225
|
-
import
|
|
14887
|
+
import chalk54 from "chalk";
|
|
15226
14888
|
var enableCommand = new Command60().name("enable").description("Enable a schedule").argument("<agent-name>", "Agent name").option(
|
|
15227
14889
|
"-n, --name <schedule-name>",
|
|
15228
14890
|
"Schedule name (required when agent has multiple schedules)"
|
|
@@ -15234,14 +14896,14 @@ var enableCommand = new Command60().name("enable").description("Enable a schedul
|
|
|
15234
14896
|
composeId: resolved.composeId
|
|
15235
14897
|
});
|
|
15236
14898
|
console.log(
|
|
15237
|
-
|
|
14899
|
+
chalk54.green(`\u2713 Enabled schedule for agent ${chalk54.cyan(agentName)}`)
|
|
15238
14900
|
);
|
|
15239
14901
|
})
|
|
15240
14902
|
);
|
|
15241
14903
|
|
|
15242
14904
|
// src/commands/schedule/disable.ts
|
|
15243
14905
|
import { Command as Command61 } from "commander";
|
|
15244
|
-
import
|
|
14906
|
+
import chalk55 from "chalk";
|
|
15245
14907
|
var disableCommand = new Command61().name("disable").description("Disable a schedule").argument("<agent-name>", "Agent name").option(
|
|
15246
14908
|
"-n, --name <schedule-name>",
|
|
15247
14909
|
"Schedule name (required when agent has multiple schedules)"
|
|
@@ -15253,7 +14915,7 @@ var disableCommand = new Command61().name("disable").description("Disable a sche
|
|
|
15253
14915
|
composeId: resolved.composeId
|
|
15254
14916
|
});
|
|
15255
14917
|
console.log(
|
|
15256
|
-
|
|
14918
|
+
chalk55.green(`\u2713 Disabled schedule for agent ${chalk55.cyan(agentName)}`)
|
|
15257
14919
|
);
|
|
15258
14920
|
})
|
|
15259
14921
|
);
|
|
@@ -15263,7 +14925,7 @@ var scheduleCommand = new Command62().name("schedule").description("Manage agent
|
|
|
15263
14925
|
|
|
15264
14926
|
// src/commands/usage/index.ts
|
|
15265
14927
|
import { Command as Command63 } from "commander";
|
|
15266
|
-
import
|
|
14928
|
+
import chalk56 from "chalk";
|
|
15267
14929
|
|
|
15268
14930
|
// src/lib/utils/duration-formatter.ts
|
|
15269
14931
|
function formatDuration(ms) {
|
|
@@ -15388,19 +15050,19 @@ var usageCommand = new Command63().name("usage").description("View usage statist
|
|
|
15388
15050
|
);
|
|
15389
15051
|
console.log();
|
|
15390
15052
|
console.log(
|
|
15391
|
-
|
|
15053
|
+
chalk56.bold(
|
|
15392
15054
|
`Usage Summary (${formatDateRange(usage.period.start, usage.period.end)})`
|
|
15393
15055
|
)
|
|
15394
15056
|
);
|
|
15395
15057
|
console.log();
|
|
15396
|
-
console.log(
|
|
15058
|
+
console.log(chalk56.dim("DATE RUNS RUN TIME"));
|
|
15397
15059
|
for (const day of filledDaily) {
|
|
15398
15060
|
const dateDisplay = formatDateDisplay(day.date).padEnd(10);
|
|
15399
15061
|
const runsDisplay = String(day.run_count).padStart(6);
|
|
15400
15062
|
const timeDisplay = formatDuration(day.run_time_ms);
|
|
15401
15063
|
console.log(`${dateDisplay}${runsDisplay} ${timeDisplay}`);
|
|
15402
15064
|
}
|
|
15403
|
-
console.log(
|
|
15065
|
+
console.log(chalk56.dim("\u2500".repeat(29)));
|
|
15404
15066
|
const totalRunsDisplay = String(usage.summary.total_runs).padStart(6);
|
|
15405
15067
|
const totalTimeDisplay = formatDuration(usage.summary.total_run_time_ms);
|
|
15406
15068
|
console.log(
|
|
@@ -15415,62 +15077,62 @@ import { Command as Command67 } from "commander";
|
|
|
15415
15077
|
|
|
15416
15078
|
// src/commands/secret/list.ts
|
|
15417
15079
|
import { Command as Command64 } from "commander";
|
|
15418
|
-
import
|
|
15080
|
+
import chalk57 from "chalk";
|
|
15419
15081
|
var listCommand8 = new Command64().name("list").alias("ls").description("List all secrets").action(
|
|
15420
15082
|
withErrorHandler(async () => {
|
|
15421
15083
|
const result = await listSecrets();
|
|
15422
15084
|
if (result.secrets.length === 0) {
|
|
15423
|
-
console.log(
|
|
15085
|
+
console.log(chalk57.dim("No secrets found"));
|
|
15424
15086
|
console.log();
|
|
15425
15087
|
console.log("To add a secret:");
|
|
15426
|
-
console.log(
|
|
15088
|
+
console.log(chalk57.cyan(" vm0 secret set MY_API_KEY --body <value>"));
|
|
15427
15089
|
return;
|
|
15428
15090
|
}
|
|
15429
|
-
console.log(
|
|
15091
|
+
console.log(chalk57.bold("Secrets:"));
|
|
15430
15092
|
console.log();
|
|
15431
15093
|
for (const secret of result.secrets) {
|
|
15432
15094
|
let typeIndicator = "";
|
|
15433
15095
|
let derivedLine = null;
|
|
15434
15096
|
if (secret.type === "model-provider") {
|
|
15435
|
-
typeIndicator =
|
|
15097
|
+
typeIndicator = chalk57.dim(" [model-provider]");
|
|
15436
15098
|
} else if (secret.type === "connector") {
|
|
15437
15099
|
const derived = getConnectorDerivedNames(secret.name);
|
|
15438
15100
|
if (derived) {
|
|
15439
|
-
typeIndicator =
|
|
15440
|
-
derivedLine =
|
|
15101
|
+
typeIndicator = chalk57.dim(` [${derived.connectorLabel} connector]`);
|
|
15102
|
+
derivedLine = chalk57.dim(
|
|
15441
15103
|
`Available as: ${derived.envVarNames.join(", ")}`
|
|
15442
15104
|
);
|
|
15443
15105
|
} else {
|
|
15444
|
-
typeIndicator =
|
|
15106
|
+
typeIndicator = chalk57.dim(" [connector]");
|
|
15445
15107
|
}
|
|
15446
15108
|
} else if (secret.type === "user") {
|
|
15447
15109
|
const derived = getConnectorDerivedNames(secret.name);
|
|
15448
15110
|
if (derived) {
|
|
15449
|
-
typeIndicator =
|
|
15450
|
-
derivedLine =
|
|
15111
|
+
typeIndicator = chalk57.dim(` [${derived.connectorLabel} connector]`);
|
|
15112
|
+
derivedLine = chalk57.dim(
|
|
15451
15113
|
`Available as: ${derived.envVarNames.join(", ")}`
|
|
15452
15114
|
);
|
|
15453
15115
|
}
|
|
15454
15116
|
}
|
|
15455
|
-
console.log(` ${
|
|
15117
|
+
console.log(` ${chalk57.cyan(secret.name)}${typeIndicator}`);
|
|
15456
15118
|
if (derivedLine) {
|
|
15457
15119
|
console.log(` ${derivedLine}`);
|
|
15458
15120
|
}
|
|
15459
15121
|
if (secret.description) {
|
|
15460
|
-
console.log(` ${
|
|
15122
|
+
console.log(` ${chalk57.dim(secret.description)}`);
|
|
15461
15123
|
}
|
|
15462
15124
|
console.log(
|
|
15463
|
-
` ${
|
|
15125
|
+
` ${chalk57.dim(`Updated: ${new Date(secret.updatedAt).toLocaleString()}`)}`
|
|
15464
15126
|
);
|
|
15465
15127
|
console.log();
|
|
15466
15128
|
}
|
|
15467
|
-
console.log(
|
|
15129
|
+
console.log(chalk57.dim(`Total: ${result.secrets.length} secret(s)`));
|
|
15468
15130
|
})
|
|
15469
15131
|
);
|
|
15470
15132
|
|
|
15471
15133
|
// src/commands/secret/set.ts
|
|
15472
15134
|
import { Command as Command65 } from "commander";
|
|
15473
|
-
import
|
|
15135
|
+
import chalk58 from "chalk";
|
|
15474
15136
|
var setCommand2 = new Command65().name("set").description("Create or update a secret").argument("<name>", "Secret name (uppercase, e.g., MY_API_KEY)").option(
|
|
15475
15137
|
"-b, --body <value>",
|
|
15476
15138
|
"Secret value (required in non-interactive mode)"
|
|
@@ -15510,18 +15172,18 @@ var setCommand2 = new Command65().name("set").description("Create or update a se
|
|
|
15510
15172
|
}
|
|
15511
15173
|
throw error;
|
|
15512
15174
|
}
|
|
15513
|
-
console.log(
|
|
15175
|
+
console.log(chalk58.green(`\u2713 Secret "${secret.name}" saved`));
|
|
15514
15176
|
console.log();
|
|
15515
15177
|
console.log("Use in vm0.yaml:");
|
|
15516
|
-
console.log(
|
|
15517
|
-
console.log(
|
|
15178
|
+
console.log(chalk58.cyan(` environment:`));
|
|
15179
|
+
console.log(chalk58.cyan(` ${name}: \${{ secrets.${name} }}`));
|
|
15518
15180
|
}
|
|
15519
15181
|
)
|
|
15520
15182
|
);
|
|
15521
15183
|
|
|
15522
15184
|
// src/commands/secret/delete.ts
|
|
15523
15185
|
import { Command as Command66 } from "commander";
|
|
15524
|
-
import
|
|
15186
|
+
import chalk59 from "chalk";
|
|
15525
15187
|
var deleteCommand3 = new Command66().name("delete").description("Delete a secret").argument("<name>", "Secret name to delete").option("-y, --yes", "Skip confirmation prompt").action(
|
|
15526
15188
|
withErrorHandler(async (name, options) => {
|
|
15527
15189
|
try {
|
|
@@ -15541,12 +15203,12 @@ var deleteCommand3 = new Command66().name("delete").description("Delete a secret
|
|
|
15541
15203
|
false
|
|
15542
15204
|
);
|
|
15543
15205
|
if (!confirmed) {
|
|
15544
|
-
console.log(
|
|
15206
|
+
console.log(chalk59.dim("Cancelled"));
|
|
15545
15207
|
return;
|
|
15546
15208
|
}
|
|
15547
15209
|
}
|
|
15548
15210
|
await deleteSecret(name);
|
|
15549
|
-
console.log(
|
|
15211
|
+
console.log(chalk59.green(`\u2713 Secret "${name}" deleted`));
|
|
15550
15212
|
})
|
|
15551
15213
|
);
|
|
15552
15214
|
|
|
@@ -15558,7 +15220,7 @@ import { Command as Command71 } from "commander";
|
|
|
15558
15220
|
|
|
15559
15221
|
// src/commands/variable/list.ts
|
|
15560
15222
|
import { Command as Command68 } from "commander";
|
|
15561
|
-
import
|
|
15223
|
+
import chalk60 from "chalk";
|
|
15562
15224
|
function truncateValue(value, maxLength = 60) {
|
|
15563
15225
|
if (value.length <= maxLength) {
|
|
15564
15226
|
return value;
|
|
@@ -15569,32 +15231,32 @@ var listCommand9 = new Command68().name("list").alias("ls").description("List al
|
|
|
15569
15231
|
withErrorHandler(async () => {
|
|
15570
15232
|
const result = await listVariables();
|
|
15571
15233
|
if (result.variables.length === 0) {
|
|
15572
|
-
console.log(
|
|
15234
|
+
console.log(chalk60.dim("No variables found"));
|
|
15573
15235
|
console.log();
|
|
15574
15236
|
console.log("To add a variable:");
|
|
15575
|
-
console.log(
|
|
15237
|
+
console.log(chalk60.cyan(" vm0 variable set MY_VAR <value>"));
|
|
15576
15238
|
return;
|
|
15577
15239
|
}
|
|
15578
|
-
console.log(
|
|
15240
|
+
console.log(chalk60.bold("Variables:"));
|
|
15579
15241
|
console.log();
|
|
15580
15242
|
for (const variable of result.variables) {
|
|
15581
15243
|
const displayValue = truncateValue(variable.value);
|
|
15582
|
-
console.log(` ${
|
|
15244
|
+
console.log(` ${chalk60.cyan(variable.name)} = ${displayValue}`);
|
|
15583
15245
|
if (variable.description) {
|
|
15584
|
-
console.log(` ${
|
|
15246
|
+
console.log(` ${chalk60.dim(variable.description)}`);
|
|
15585
15247
|
}
|
|
15586
15248
|
console.log(
|
|
15587
|
-
` ${
|
|
15249
|
+
` ${chalk60.dim(`Updated: ${new Date(variable.updatedAt).toLocaleString()}`)}`
|
|
15588
15250
|
);
|
|
15589
15251
|
console.log();
|
|
15590
15252
|
}
|
|
15591
|
-
console.log(
|
|
15253
|
+
console.log(chalk60.dim(`Total: ${result.variables.length} variable(s)`));
|
|
15592
15254
|
})
|
|
15593
15255
|
);
|
|
15594
15256
|
|
|
15595
15257
|
// src/commands/variable/set.ts
|
|
15596
15258
|
import { Command as Command69 } from "commander";
|
|
15597
|
-
import
|
|
15259
|
+
import chalk61 from "chalk";
|
|
15598
15260
|
var setCommand3 = new Command69().name("set").description("Create or update a variable").argument("<name>", "Variable name (uppercase, e.g., MY_VAR)").argument("<value>", "Variable value").option("-d, --description <description>", "Optional description").action(
|
|
15599
15261
|
withErrorHandler(
|
|
15600
15262
|
async (name, value, options) => {
|
|
@@ -15615,18 +15277,18 @@ var setCommand3 = new Command69().name("set").description("Create or update a va
|
|
|
15615
15277
|
}
|
|
15616
15278
|
throw error;
|
|
15617
15279
|
}
|
|
15618
|
-
console.log(
|
|
15280
|
+
console.log(chalk61.green(`\u2713 Variable "${variable.name}" saved`));
|
|
15619
15281
|
console.log();
|
|
15620
15282
|
console.log("Use in vm0.yaml:");
|
|
15621
|
-
console.log(
|
|
15622
|
-
console.log(
|
|
15283
|
+
console.log(chalk61.cyan(` environment:`));
|
|
15284
|
+
console.log(chalk61.cyan(` ${name}: \${{ vars.${name} }}`));
|
|
15623
15285
|
}
|
|
15624
15286
|
)
|
|
15625
15287
|
);
|
|
15626
15288
|
|
|
15627
15289
|
// src/commands/variable/delete.ts
|
|
15628
15290
|
import { Command as Command70 } from "commander";
|
|
15629
|
-
import
|
|
15291
|
+
import chalk62 from "chalk";
|
|
15630
15292
|
var deleteCommand4 = new Command70().name("delete").description("Delete a variable").argument("<name>", "Variable name to delete").option("-y, --yes", "Skip confirmation prompt").action(
|
|
15631
15293
|
withErrorHandler(async (name, options) => {
|
|
15632
15294
|
try {
|
|
@@ -15646,12 +15308,12 @@ var deleteCommand4 = new Command70().name("delete").description("Delete a variab
|
|
|
15646
15308
|
false
|
|
15647
15309
|
);
|
|
15648
15310
|
if (!confirmed) {
|
|
15649
|
-
console.log(
|
|
15311
|
+
console.log(chalk62.dim("Cancelled"));
|
|
15650
15312
|
return;
|
|
15651
15313
|
}
|
|
15652
15314
|
}
|
|
15653
15315
|
await deleteVariable(name);
|
|
15654
|
-
console.log(
|
|
15316
|
+
console.log(chalk62.green(`\u2713 Variable "${name}" deleted`));
|
|
15655
15317
|
})
|
|
15656
15318
|
);
|
|
15657
15319
|
|
|
@@ -15663,15 +15325,15 @@ import { Command as Command76 } from "commander";
|
|
|
15663
15325
|
|
|
15664
15326
|
// src/commands/model-provider/list.ts
|
|
15665
15327
|
import { Command as Command72 } from "commander";
|
|
15666
|
-
import
|
|
15328
|
+
import chalk63 from "chalk";
|
|
15667
15329
|
var listCommand10 = new Command72().name("list").alias("ls").description("List all model providers").action(
|
|
15668
15330
|
withErrorHandler(async () => {
|
|
15669
15331
|
const result = await listModelProviders();
|
|
15670
15332
|
if (result.modelProviders.length === 0) {
|
|
15671
|
-
console.log(
|
|
15333
|
+
console.log(chalk63.dim("No model providers configured"));
|
|
15672
15334
|
console.log();
|
|
15673
15335
|
console.log("To add a model provider:");
|
|
15674
|
-
console.log(
|
|
15336
|
+
console.log(chalk63.cyan(" vm0 model-provider setup"));
|
|
15675
15337
|
return;
|
|
15676
15338
|
}
|
|
15677
15339
|
const byFramework = result.modelProviders.reduce(
|
|
@@ -15685,16 +15347,16 @@ var listCommand10 = new Command72().name("list").alias("ls").description("List a
|
|
|
15685
15347
|
},
|
|
15686
15348
|
{}
|
|
15687
15349
|
);
|
|
15688
|
-
console.log(
|
|
15350
|
+
console.log(chalk63.bold("Model Providers:"));
|
|
15689
15351
|
console.log();
|
|
15690
15352
|
for (const [framework, providers] of Object.entries(byFramework)) {
|
|
15691
|
-
console.log(` ${
|
|
15353
|
+
console.log(` ${chalk63.cyan(framework)}:`);
|
|
15692
15354
|
for (const provider of providers) {
|
|
15693
|
-
const defaultTag = provider.isDefault ?
|
|
15694
|
-
const modelTag = provider.selectedModel ?
|
|
15355
|
+
const defaultTag = provider.isDefault ? chalk63.green(" (default)") : "";
|
|
15356
|
+
const modelTag = provider.selectedModel ? chalk63.dim(` [${provider.selectedModel}]`) : "";
|
|
15695
15357
|
console.log(` ${provider.type}${defaultTag}${modelTag}`);
|
|
15696
15358
|
console.log(
|
|
15697
|
-
|
|
15359
|
+
chalk63.dim(
|
|
15698
15360
|
` Updated: ${new Date(provider.updatedAt).toLocaleString()}`
|
|
15699
15361
|
)
|
|
15700
15362
|
);
|
|
@@ -15702,14 +15364,14 @@ var listCommand10 = new Command72().name("list").alias("ls").description("List a
|
|
|
15702
15364
|
console.log();
|
|
15703
15365
|
}
|
|
15704
15366
|
console.log(
|
|
15705
|
-
|
|
15367
|
+
chalk63.dim(`Total: ${result.modelProviders.length} provider(s)`)
|
|
15706
15368
|
);
|
|
15707
15369
|
})
|
|
15708
15370
|
);
|
|
15709
15371
|
|
|
15710
15372
|
// src/commands/model-provider/setup.ts
|
|
15711
15373
|
import { Command as Command73 } from "commander";
|
|
15712
|
-
import
|
|
15374
|
+
import chalk64 from "chalk";
|
|
15713
15375
|
import prompts2 from "prompts";
|
|
15714
15376
|
function validateProviderType(typeStr) {
|
|
15715
15377
|
if (!Object.keys(MODEL_PROVIDER_TYPES).includes(typeStr)) {
|
|
@@ -15893,7 +15555,7 @@ async function promptForModelSelection(type2) {
|
|
|
15893
15555
|
if (selected === "__custom__") {
|
|
15894
15556
|
const placeholder = getCustomModelPlaceholder(type2);
|
|
15895
15557
|
if (placeholder) {
|
|
15896
|
-
console.log(
|
|
15558
|
+
console.log(chalk64.dim(`Example: ${placeholder}`));
|
|
15897
15559
|
}
|
|
15898
15560
|
const customResponse = await prompts2(
|
|
15899
15561
|
{
|
|
@@ -15943,7 +15605,7 @@ async function promptForSecrets(type2, authMethod) {
|
|
|
15943
15605
|
const secrets = {};
|
|
15944
15606
|
for (const [name, fieldConfig] of Object.entries(secretsConfig)) {
|
|
15945
15607
|
if (fieldConfig.helpText) {
|
|
15946
|
-
console.log(
|
|
15608
|
+
console.log(chalk64.dim(fieldConfig.helpText));
|
|
15947
15609
|
}
|
|
15948
15610
|
const isSensitive = isSensitiveSecret(name);
|
|
15949
15611
|
const placeholder = "placeholder" in fieldConfig ? fieldConfig.placeholder : "";
|
|
@@ -15995,7 +15657,7 @@ async function handleInteractiveMode() {
|
|
|
15995
15657
|
title = `${title} \u2713`;
|
|
15996
15658
|
}
|
|
15997
15659
|
if (isExperimental) {
|
|
15998
|
-
title = `${title} ${
|
|
15660
|
+
title = `${title} ${chalk64.dim("(experimental)")}`;
|
|
15999
15661
|
}
|
|
16000
15662
|
return {
|
|
16001
15663
|
title,
|
|
@@ -16042,7 +15704,7 @@ async function handleInteractiveMode() {
|
|
|
16042
15704
|
}
|
|
16043
15705
|
const config = MODEL_PROVIDER_TYPES[type2];
|
|
16044
15706
|
console.log();
|
|
16045
|
-
console.log(
|
|
15707
|
+
console.log(chalk64.dim(config.helpText));
|
|
16046
15708
|
console.log();
|
|
16047
15709
|
if (hasAuthMethods(type2)) {
|
|
16048
15710
|
const authMethod = await promptForAuthMethod(type2);
|
|
@@ -16083,7 +15745,7 @@ async function promptSetAsDefault(type2, framework, isDefault) {
|
|
|
16083
15745
|
);
|
|
16084
15746
|
if (response.setDefault) {
|
|
16085
15747
|
await setModelProviderDefault(type2);
|
|
16086
|
-
console.log(
|
|
15748
|
+
console.log(chalk64.green(`\u2713 Default for ${framework} set to "${type2}"`));
|
|
16087
15749
|
}
|
|
16088
15750
|
}
|
|
16089
15751
|
function collectSecrets(value, previous) {
|
|
@@ -16127,11 +15789,11 @@ var setupCommand2 = new Command73().name("setup").description("Configure a model
|
|
|
16127
15789
|
const modelNote2 = provider2.selectedModel ? ` with model: ${provider2.selectedModel}` : "";
|
|
16128
15790
|
if (!hasModelSelection(input.type)) {
|
|
16129
15791
|
console.log(
|
|
16130
|
-
|
|
15792
|
+
chalk64.green(`\u2713 Model provider "${input.type}" unchanged`)
|
|
16131
15793
|
);
|
|
16132
15794
|
} else {
|
|
16133
15795
|
console.log(
|
|
16134
|
-
|
|
15796
|
+
chalk64.green(
|
|
16135
15797
|
`\u2713 Model provider "${input.type}" updated${defaultNote2}${modelNote2}`
|
|
16136
15798
|
)
|
|
16137
15799
|
);
|
|
@@ -16156,7 +15818,7 @@ var setupCommand2 = new Command73().name("setup").description("Configure a model
|
|
|
16156
15818
|
const defaultNote = provider.isDefault ? ` (default for ${provider.framework})` : "";
|
|
16157
15819
|
const modelNote = provider.selectedModel ? ` with model: ${provider.selectedModel}` : "";
|
|
16158
15820
|
console.log(
|
|
16159
|
-
|
|
15821
|
+
chalk64.green(
|
|
16160
15822
|
`\u2713 Model provider "${input.type}" ${action}${defaultNote}${modelNote}`
|
|
16161
15823
|
)
|
|
16162
15824
|
);
|
|
@@ -16173,7 +15835,7 @@ var setupCommand2 = new Command73().name("setup").description("Configure a model
|
|
|
16173
15835
|
|
|
16174
15836
|
// src/commands/model-provider/delete.ts
|
|
16175
15837
|
import { Command as Command74 } from "commander";
|
|
16176
|
-
import
|
|
15838
|
+
import chalk65 from "chalk";
|
|
16177
15839
|
var deleteCommand5 = new Command74().name("delete").description("Delete a model provider").argument("<type>", "Model provider type to delete").action(
|
|
16178
15840
|
withErrorHandler(async (type2) => {
|
|
16179
15841
|
if (!Object.keys(MODEL_PROVIDER_TYPES).includes(type2)) {
|
|
@@ -16183,13 +15845,13 @@ var deleteCommand5 = new Command74().name("delete").description("Delete a model
|
|
|
16183
15845
|
});
|
|
16184
15846
|
}
|
|
16185
15847
|
await deleteModelProvider(type2);
|
|
16186
|
-
console.log(
|
|
15848
|
+
console.log(chalk65.green(`\u2713 Model provider "${type2}" deleted`));
|
|
16187
15849
|
})
|
|
16188
15850
|
);
|
|
16189
15851
|
|
|
16190
15852
|
// src/commands/model-provider/set-default.ts
|
|
16191
15853
|
import { Command as Command75 } from "commander";
|
|
16192
|
-
import
|
|
15854
|
+
import chalk66 from "chalk";
|
|
16193
15855
|
var setDefaultCommand = new Command75().name("set-default").description("Set a model provider as default for its framework").argument("<type>", "Model provider type to set as default").action(
|
|
16194
15856
|
withErrorHandler(async (type2) => {
|
|
16195
15857
|
if (!Object.keys(MODEL_PROVIDER_TYPES).includes(type2)) {
|
|
@@ -16200,7 +15862,7 @@ var setDefaultCommand = new Command75().name("set-default").description("Set a m
|
|
|
16200
15862
|
}
|
|
16201
15863
|
const provider = await setModelProviderDefault(type2);
|
|
16202
15864
|
console.log(
|
|
16203
|
-
|
|
15865
|
+
chalk66.green(
|
|
16204
15866
|
`\u2713 Default for ${provider.framework} set to "${provider.type}"`
|
|
16205
15867
|
)
|
|
16206
15868
|
);
|
|
@@ -16215,7 +15877,7 @@ import { Command as Command81 } from "commander";
|
|
|
16215
15877
|
|
|
16216
15878
|
// src/commands/connector/connect.ts
|
|
16217
15879
|
import { Command as Command77 } from "commander";
|
|
16218
|
-
import
|
|
15880
|
+
import chalk68 from "chalk";
|
|
16219
15881
|
import { initClient as initClient13 } from "@ts-rest/core";
|
|
16220
15882
|
|
|
16221
15883
|
// src/commands/connector/lib/computer/start-services.ts
|
|
@@ -16224,7 +15886,7 @@ import { access as access2, constants } from "fs/promises";
|
|
|
16224
15886
|
import { createServer } from "net";
|
|
16225
15887
|
import { homedir as homedir4 } from "os";
|
|
16226
15888
|
import { join as join12 } from "path";
|
|
16227
|
-
import
|
|
15889
|
+
import chalk67 from "chalk";
|
|
16228
15890
|
|
|
16229
15891
|
// src/commands/connector/lib/computer/ngrok.ts
|
|
16230
15892
|
import ngrok from "@ngrok/ngrok";
|
|
@@ -16298,7 +15960,7 @@ async function checkComputerDependencies() {
|
|
|
16298
15960
|
}
|
|
16299
15961
|
}
|
|
16300
15962
|
async function startComputerServices(credentials) {
|
|
16301
|
-
console.log(
|
|
15963
|
+
console.log(chalk67.cyan("Starting computer connector services..."));
|
|
16302
15964
|
const wsgidavBinary = await findBinary("wsgidav");
|
|
16303
15965
|
if (!wsgidavBinary) {
|
|
16304
15966
|
throw new Error(
|
|
@@ -16325,7 +15987,7 @@ async function startComputerServices(credentials) {
|
|
|
16325
15987
|
);
|
|
16326
15988
|
wsgidav.stdout?.on("data", (data) => process.stdout.write(data));
|
|
16327
15989
|
wsgidav.stderr?.on("data", (data) => process.stderr.write(data));
|
|
16328
|
-
console.log(
|
|
15990
|
+
console.log(chalk67.green("\u2713 WebDAV server started"));
|
|
16329
15991
|
const chrome = spawn2(
|
|
16330
15992
|
chromeBinary,
|
|
16331
15993
|
[
|
|
@@ -16339,7 +16001,7 @@ async function startComputerServices(credentials) {
|
|
|
16339
16001
|
);
|
|
16340
16002
|
chrome.stdout?.on("data", (data) => process.stdout.write(data));
|
|
16341
16003
|
chrome.stderr?.on("data", (data) => process.stderr.write(data));
|
|
16342
|
-
console.log(
|
|
16004
|
+
console.log(chalk67.green("\u2713 Chrome started"));
|
|
16343
16005
|
try {
|
|
16344
16006
|
await startNgrokTunnels(
|
|
16345
16007
|
credentials.ngrokToken,
|
|
@@ -16348,18 +16010,18 @@ async function startComputerServices(credentials) {
|
|
|
16348
16010
|
cdpPort
|
|
16349
16011
|
);
|
|
16350
16012
|
console.log(
|
|
16351
|
-
|
|
16013
|
+
chalk67.green(
|
|
16352
16014
|
`\u2713 ngrok tunnels: webdav.${credentials.domain}, chrome.${credentials.domain}`
|
|
16353
16015
|
)
|
|
16354
16016
|
);
|
|
16355
16017
|
console.log();
|
|
16356
|
-
console.log(
|
|
16018
|
+
console.log(chalk67.green("\u2713 Computer connector active"));
|
|
16357
16019
|
console.log(` WebDAV: ~/Downloads \u2192 webdav.${credentials.domain}`);
|
|
16358
16020
|
console.log(
|
|
16359
16021
|
` Chrome CDP: port ${cdpPort} \u2192 chrome.${credentials.domain}`
|
|
16360
16022
|
);
|
|
16361
16023
|
console.log();
|
|
16362
|
-
console.log(
|
|
16024
|
+
console.log(chalk67.dim("Press ^C twice to disconnect"));
|
|
16363
16025
|
console.log();
|
|
16364
16026
|
let sigintCount = 0;
|
|
16365
16027
|
await new Promise((resolve2) => {
|
|
@@ -16373,7 +16035,7 @@ async function startComputerServices(credentials) {
|
|
|
16373
16035
|
const onSigint = () => {
|
|
16374
16036
|
sigintCount++;
|
|
16375
16037
|
if (sigintCount === 1) {
|
|
16376
|
-
console.log(
|
|
16038
|
+
console.log(chalk67.dim("\nPress ^C again to disconnect and exit..."));
|
|
16377
16039
|
} else {
|
|
16378
16040
|
done();
|
|
16379
16041
|
}
|
|
@@ -16383,11 +16045,11 @@ async function startComputerServices(credentials) {
|
|
|
16383
16045
|
});
|
|
16384
16046
|
} finally {
|
|
16385
16047
|
console.log();
|
|
16386
|
-
console.log(
|
|
16048
|
+
console.log(chalk67.cyan("Stopping services..."));
|
|
16387
16049
|
wsgidav.kill("SIGTERM");
|
|
16388
16050
|
chrome.kill("SIGTERM");
|
|
16389
16051
|
await stopNgrokTunnels();
|
|
16390
|
-
console.log(
|
|
16052
|
+
console.log(chalk67.green("\u2713 Services stopped"));
|
|
16391
16053
|
}
|
|
16392
16054
|
}
|
|
16393
16055
|
|
|
@@ -16412,10 +16074,10 @@ async function getHeaders2() {
|
|
|
16412
16074
|
function renderHelpText(text) {
|
|
16413
16075
|
return text.replace(
|
|
16414
16076
|
/\[([^\]]+)\]\(([^)]+)\)/g,
|
|
16415
|
-
(_m, label, url) => `${label} (${
|
|
16416
|
-
).replace(/\*\*([^*]+)\*\*/g, (_m, content) =>
|
|
16077
|
+
(_m, label, url) => `${label} (${chalk68.cyan(url)})`
|
|
16078
|
+
).replace(/\*\*([^*]+)\*\*/g, (_m, content) => chalk68.bold(content)).replace(
|
|
16417
16079
|
/^> (.+)$/gm,
|
|
16418
|
-
(_m, content) =>
|
|
16080
|
+
(_m, content) => chalk68.yellow(` ${content}`)
|
|
16419
16081
|
);
|
|
16420
16082
|
}
|
|
16421
16083
|
async function connectViaApiToken(connectorType, tokenValue) {
|
|
@@ -16440,7 +16102,7 @@ async function connectViaApiToken(connectorType, tokenValue) {
|
|
|
16440
16102
|
for (const [secretName, secretConfig] of secretEntries) {
|
|
16441
16103
|
if (!secretConfig.required) continue;
|
|
16442
16104
|
const value = await promptPassword(
|
|
16443
|
-
`${secretConfig.label}${secretConfig.placeholder ?
|
|
16105
|
+
`${secretConfig.label}${secretConfig.placeholder ? chalk68.dim(` (${secretConfig.placeholder})`) : ""}:`
|
|
16444
16106
|
);
|
|
16445
16107
|
if (!value) {
|
|
16446
16108
|
throw new Error("Cancelled");
|
|
@@ -16456,13 +16118,13 @@ async function connectViaApiToken(connectorType, tokenValue) {
|
|
|
16456
16118
|
});
|
|
16457
16119
|
}
|
|
16458
16120
|
console.log(
|
|
16459
|
-
|
|
16121
|
+
chalk68.green(`
|
|
16460
16122
|
\u2713 ${config.label} connected successfully via API token!`)
|
|
16461
16123
|
);
|
|
16462
16124
|
}
|
|
16463
16125
|
async function connectComputer(apiUrl, headers) {
|
|
16464
16126
|
await checkComputerDependencies();
|
|
16465
|
-
console.log(
|
|
16127
|
+
console.log(chalk68.cyan("Setting up computer connector..."));
|
|
16466
16128
|
const computerClient = initClient13(computerConnectorContract, {
|
|
16467
16129
|
baseUrl: apiUrl,
|
|
16468
16130
|
baseHeaders: headers,
|
|
@@ -16477,9 +16139,9 @@ async function connectComputer(apiUrl, headers) {
|
|
|
16477
16139
|
}
|
|
16478
16140
|
const credentials = createResult.body;
|
|
16479
16141
|
await startComputerServices(credentials);
|
|
16480
|
-
console.log(
|
|
16142
|
+
console.log(chalk68.cyan("Disconnecting computer connector..."));
|
|
16481
16143
|
await deleteConnector("computer");
|
|
16482
|
-
console.log(
|
|
16144
|
+
console.log(chalk68.green("\u2713 Disconnected computer"));
|
|
16483
16145
|
process.exit(0);
|
|
16484
16146
|
}
|
|
16485
16147
|
async function resolveAuthMethod(connectorType, tokenFlag) {
|
|
@@ -16518,7 +16180,7 @@ async function resolveAuthMethod(connectorType, tokenFlag) {
|
|
|
16518
16180
|
);
|
|
16519
16181
|
}
|
|
16520
16182
|
async function connectViaOAuth(connectorType, apiUrl, headers) {
|
|
16521
|
-
console.log(`Connecting ${
|
|
16183
|
+
console.log(`Connecting ${chalk68.cyan(connectorType)}...`);
|
|
16522
16184
|
const sessionsClient = initClient13(connectorSessionsContract, {
|
|
16523
16185
|
baseUrl: apiUrl,
|
|
16524
16186
|
baseHeaders: headers,
|
|
@@ -16534,8 +16196,8 @@ async function connectViaOAuth(connectorType, apiUrl, headers) {
|
|
|
16534
16196
|
}
|
|
16535
16197
|
const session = createResult.body;
|
|
16536
16198
|
const verificationUrl = `${apiUrl}${session.verificationUrl}`;
|
|
16537
|
-
console.log(
|
|
16538
|
-
console.log(
|
|
16199
|
+
console.log(chalk68.green("\nSession created"));
|
|
16200
|
+
console.log(chalk68.cyan(`
|
|
16539
16201
|
To connect, visit: ${verificationUrl}`));
|
|
16540
16202
|
console.log(
|
|
16541
16203
|
`
|
|
@@ -16567,7 +16229,7 @@ The session expires in ${Math.floor(session.expiresIn / 60)} minutes.`
|
|
|
16567
16229
|
switch (status.status) {
|
|
16568
16230
|
case "complete":
|
|
16569
16231
|
console.log(
|
|
16570
|
-
|
|
16232
|
+
chalk68.green(`
|
|
16571
16233
|
|
|
16572
16234
|
${connectorType} connected successfully!`)
|
|
16573
16235
|
);
|
|
@@ -16579,7 +16241,7 @@ ${connectorType} connected successfully!`)
|
|
|
16579
16241
|
`Connection failed: ${status.errorMessage || "Unknown error"}`
|
|
16580
16242
|
);
|
|
16581
16243
|
case "pending":
|
|
16582
|
-
process.stdout.write(
|
|
16244
|
+
process.stdout.write(chalk68.dim("."));
|
|
16583
16245
|
break;
|
|
16584
16246
|
}
|
|
16585
16247
|
}
|
|
@@ -16611,7 +16273,7 @@ var connectCommand = new Command77().name("connect").description("Connect a thir
|
|
|
16611
16273
|
|
|
16612
16274
|
// src/commands/connector/list.ts
|
|
16613
16275
|
import { Command as Command78 } from "commander";
|
|
16614
|
-
import
|
|
16276
|
+
import chalk69 from "chalk";
|
|
16615
16277
|
var listCommand11 = new Command78().name("list").alias("ls").description("List all connectors and their status").action(
|
|
16616
16278
|
withErrorHandler(async () => {
|
|
16617
16279
|
const result = await listConnectors();
|
|
@@ -16634,23 +16296,23 @@ var listCommand11 = new Command78().name("list").alias("ls").description("List a
|
|
|
16634
16296
|
statusText.padEnd(statusWidth),
|
|
16635
16297
|
"ACCOUNT"
|
|
16636
16298
|
].join(" ");
|
|
16637
|
-
console.log(
|
|
16299
|
+
console.log(chalk69.dim(header));
|
|
16638
16300
|
for (const type2 of allTypes) {
|
|
16639
16301
|
const connector = connectedMap.get(type2);
|
|
16640
|
-
const status = connector ?
|
|
16641
|
-
const account = connector?.externalUsername ? `@${connector.externalUsername}` :
|
|
16302
|
+
const status = connector ? chalk69.green("\u2713".padEnd(statusWidth)) : chalk69.dim("-".padEnd(statusWidth));
|
|
16303
|
+
const account = connector?.externalUsername ? `@${connector.externalUsername}` : chalk69.dim("-");
|
|
16642
16304
|
const row = [type2.padEnd(typeWidth), status, account].join(" ");
|
|
16643
16305
|
console.log(row);
|
|
16644
16306
|
}
|
|
16645
16307
|
console.log();
|
|
16646
|
-
console.log(
|
|
16647
|
-
console.log(
|
|
16308
|
+
console.log(chalk69.dim("To connect a service:"));
|
|
16309
|
+
console.log(chalk69.dim(" vm0 connector connect <type>"));
|
|
16648
16310
|
})
|
|
16649
16311
|
);
|
|
16650
16312
|
|
|
16651
16313
|
// src/commands/connector/status.ts
|
|
16652
16314
|
import { Command as Command79 } from "commander";
|
|
16653
|
-
import
|
|
16315
|
+
import chalk70 from "chalk";
|
|
16654
16316
|
var LABEL_WIDTH = 16;
|
|
16655
16317
|
var statusCommand8 = new Command79().name("status").description("Show detailed status of a connector").argument("<type>", "Connector type (e.g., github)").action(
|
|
16656
16318
|
withErrorHandler(async (type2) => {
|
|
@@ -16662,11 +16324,11 @@ var statusCommand8 = new Command79().name("status").description("Show detailed s
|
|
|
16662
16324
|
});
|
|
16663
16325
|
}
|
|
16664
16326
|
const connector = await getConnector(parseResult.data);
|
|
16665
|
-
console.log(`Connector: ${
|
|
16327
|
+
console.log(`Connector: ${chalk70.cyan(type2)}`);
|
|
16666
16328
|
console.log();
|
|
16667
16329
|
if (connector) {
|
|
16668
16330
|
console.log(
|
|
16669
|
-
`${"Status:".padEnd(LABEL_WIDTH)}${
|
|
16331
|
+
`${"Status:".padEnd(LABEL_WIDTH)}${chalk70.green("connected")}`
|
|
16670
16332
|
);
|
|
16671
16333
|
console.log(
|
|
16672
16334
|
`${"Account:".padEnd(LABEL_WIDTH)}@${connector.externalUsername}`
|
|
@@ -16688,22 +16350,22 @@ var statusCommand8 = new Command79().name("status").description("Show detailed s
|
|
|
16688
16350
|
);
|
|
16689
16351
|
}
|
|
16690
16352
|
console.log();
|
|
16691
|
-
console.log(
|
|
16692
|
-
console.log(
|
|
16353
|
+
console.log(chalk70.dim("To disconnect:"));
|
|
16354
|
+
console.log(chalk70.dim(` vm0 connector disconnect ${type2}`));
|
|
16693
16355
|
} else {
|
|
16694
16356
|
console.log(
|
|
16695
|
-
`${"Status:".padEnd(LABEL_WIDTH)}${
|
|
16357
|
+
`${"Status:".padEnd(LABEL_WIDTH)}${chalk70.dim("not connected")}`
|
|
16696
16358
|
);
|
|
16697
16359
|
console.log();
|
|
16698
|
-
console.log(
|
|
16699
|
-
console.log(
|
|
16360
|
+
console.log(chalk70.dim("To connect:"));
|
|
16361
|
+
console.log(chalk70.dim(` vm0 connector connect ${type2}`));
|
|
16700
16362
|
}
|
|
16701
16363
|
})
|
|
16702
16364
|
);
|
|
16703
16365
|
|
|
16704
16366
|
// src/commands/connector/disconnect.ts
|
|
16705
16367
|
import { Command as Command80 } from "commander";
|
|
16706
|
-
import
|
|
16368
|
+
import chalk71 from "chalk";
|
|
16707
16369
|
var disconnectCommand = new Command80().name("disconnect").description("Disconnect a third-party service").argument("<type>", "Connector type to disconnect (e.g., github)").action(
|
|
16708
16370
|
withErrorHandler(async (type2) => {
|
|
16709
16371
|
const parseResult = connectorTypeSchema.safeParse(type2);
|
|
@@ -16715,7 +16377,7 @@ var disconnectCommand = new Command80().name("disconnect").description("Disconne
|
|
|
16715
16377
|
}
|
|
16716
16378
|
const connectorType = parseResult.data;
|
|
16717
16379
|
await deleteConnector(connectorType);
|
|
16718
|
-
console.log(
|
|
16380
|
+
console.log(chalk71.green(`\u2713 Disconnected ${type2}`));
|
|
16719
16381
|
})
|
|
16720
16382
|
);
|
|
16721
16383
|
|
|
@@ -16724,24 +16386,24 @@ var connectorCommand = new Command81().name("connector").description("Manage thi
|
|
|
16724
16386
|
|
|
16725
16387
|
// src/commands/onboard/index.ts
|
|
16726
16388
|
import { Command as Command82 } from "commander";
|
|
16727
|
-
import
|
|
16389
|
+
import chalk75 from "chalk";
|
|
16728
16390
|
import { mkdir as mkdir8 } from "fs/promises";
|
|
16729
16391
|
import { existsSync as existsSync12 } from "fs";
|
|
16730
16392
|
|
|
16731
16393
|
// src/lib/ui/welcome-box.ts
|
|
16732
|
-
import
|
|
16394
|
+
import chalk72 from "chalk";
|
|
16733
16395
|
var gradientColors = [
|
|
16734
|
-
|
|
16396
|
+
chalk72.hex("#FFAB5E"),
|
|
16735
16397
|
// Line 1 - lightest
|
|
16736
|
-
|
|
16398
|
+
chalk72.hex("#FF9642"),
|
|
16737
16399
|
// Line 2
|
|
16738
|
-
|
|
16400
|
+
chalk72.hex("#FF8228"),
|
|
16739
16401
|
// Line 3
|
|
16740
|
-
|
|
16402
|
+
chalk72.hex("#FF6D0A"),
|
|
16741
16403
|
// Line 4
|
|
16742
|
-
|
|
16404
|
+
chalk72.hex("#E85D00"),
|
|
16743
16405
|
// Line 5
|
|
16744
|
-
|
|
16406
|
+
chalk72.hex("#CC4E00")
|
|
16745
16407
|
// Line 6 - darkest
|
|
16746
16408
|
];
|
|
16747
16409
|
var vm0LogoLines = [
|
|
@@ -16763,15 +16425,15 @@ function renderVm0Banner() {
|
|
|
16763
16425
|
function renderOnboardWelcome() {
|
|
16764
16426
|
renderVm0Banner();
|
|
16765
16427
|
console.log(` Build agentic workflows using natural language.`);
|
|
16766
|
-
console.log(` ${
|
|
16428
|
+
console.log(` ${chalk72.dim("Currently in beta, enjoy it free")}`);
|
|
16767
16429
|
console.log(
|
|
16768
|
-
` ${
|
|
16430
|
+
` ${chalk72.dim("Star us on GitHub: https://github.com/vm0-ai/vm0")}`
|
|
16769
16431
|
);
|
|
16770
16432
|
console.log();
|
|
16771
16433
|
}
|
|
16772
16434
|
|
|
16773
16435
|
// src/lib/ui/step-runner.ts
|
|
16774
|
-
import
|
|
16436
|
+
import chalk73 from "chalk";
|
|
16775
16437
|
function createStepRunner(options = true) {
|
|
16776
16438
|
const opts = typeof options === "boolean" ? { interactive: options } : options;
|
|
16777
16439
|
const interactive = opts.interactive ?? true;
|
|
@@ -16786,25 +16448,25 @@ function createStepRunner(options = true) {
|
|
|
16786
16448
|
}
|
|
16787
16449
|
for (const [i, step] of completedSteps.entries()) {
|
|
16788
16450
|
if (step.failed) {
|
|
16789
|
-
console.log(
|
|
16451
|
+
console.log(chalk73.red(`\u2717 ${step.label}`));
|
|
16790
16452
|
} else {
|
|
16791
|
-
console.log(
|
|
16453
|
+
console.log(chalk73.green(`\u25CF ${step.label}`));
|
|
16792
16454
|
}
|
|
16793
16455
|
const isLastStep = i === completedSteps.length - 1;
|
|
16794
16456
|
if (!isLastStep || !isFinal) {
|
|
16795
|
-
console.log(
|
|
16457
|
+
console.log(chalk73.dim("\u2502"));
|
|
16796
16458
|
}
|
|
16797
16459
|
}
|
|
16798
16460
|
}
|
|
16799
16461
|
async function executeStep(label, fn, isFinal) {
|
|
16800
16462
|
let stepFailed = false;
|
|
16801
|
-
console.log(
|
|
16463
|
+
console.log(chalk73.yellow(`\u25CB ${label}`));
|
|
16802
16464
|
const ctx = {
|
|
16803
16465
|
connector() {
|
|
16804
|
-
console.log(
|
|
16466
|
+
console.log(chalk73.dim("\u2502"));
|
|
16805
16467
|
},
|
|
16806
16468
|
detail(message) {
|
|
16807
|
-
console.log(`${
|
|
16469
|
+
console.log(`${chalk73.dim("\u2502")} ${message}`);
|
|
16808
16470
|
},
|
|
16809
16471
|
async prompt(promptFn) {
|
|
16810
16472
|
return await promptFn();
|
|
@@ -16821,12 +16483,12 @@ function createStepRunner(options = true) {
|
|
|
16821
16483
|
redrawCompletedSteps(isFinal);
|
|
16822
16484
|
} else {
|
|
16823
16485
|
if (stepFailed) {
|
|
16824
|
-
console.log(
|
|
16486
|
+
console.log(chalk73.red(`\u2717 ${label}`));
|
|
16825
16487
|
} else {
|
|
16826
|
-
console.log(
|
|
16488
|
+
console.log(chalk73.green(`\u25CF ${label}`));
|
|
16827
16489
|
}
|
|
16828
16490
|
if (!isFinal) {
|
|
16829
|
-
console.log(
|
|
16491
|
+
console.log(chalk73.dim("\u2502"));
|
|
16830
16492
|
}
|
|
16831
16493
|
}
|
|
16832
16494
|
}
|
|
@@ -16986,7 +16648,7 @@ async function setupModelProvider(type2, secret, options) {
|
|
|
16986
16648
|
|
|
16987
16649
|
// src/lib/domain/onboard/claude-setup.ts
|
|
16988
16650
|
import { spawn as spawn3 } from "child_process";
|
|
16989
|
-
import
|
|
16651
|
+
import chalk74 from "chalk";
|
|
16990
16652
|
var MARKETPLACE_NAME = "vm0-skills";
|
|
16991
16653
|
var MARKETPLACE_REPO = "vm0-ai/vm0-skills";
|
|
16992
16654
|
var PLUGIN_ID = "vm0@vm0-skills";
|
|
@@ -17023,12 +16685,12 @@ async function runClaudeCommand(args, cwd) {
|
|
|
17023
16685
|
}
|
|
17024
16686
|
function handlePluginError(error, context) {
|
|
17025
16687
|
const displayContext = context ?? "Claude plugin";
|
|
17026
|
-
console.error(
|
|
16688
|
+
console.error(chalk74.red(`\u2717 Failed to install ${displayContext}`));
|
|
17027
16689
|
if (error instanceof Error) {
|
|
17028
|
-
console.error(
|
|
16690
|
+
console.error(chalk74.red(`\u2717 ${error.message}`));
|
|
17029
16691
|
}
|
|
17030
16692
|
console.error(
|
|
17031
|
-
|
|
16693
|
+
chalk74.dim("Please ensure Claude CLI is installed and accessible.")
|
|
17032
16694
|
);
|
|
17033
16695
|
process.exit(1);
|
|
17034
16696
|
}
|
|
@@ -17071,7 +16733,7 @@ async function updateMarketplace() {
|
|
|
17071
16733
|
]);
|
|
17072
16734
|
if (!result.success) {
|
|
17073
16735
|
console.warn(
|
|
17074
|
-
|
|
16736
|
+
chalk74.yellow(
|
|
17075
16737
|
`Warning: Could not update marketplace: ${result.error ?? "unknown error"}`
|
|
17076
16738
|
)
|
|
17077
16739
|
);
|
|
@@ -17117,9 +16779,9 @@ async function handleAuthentication(ctx) {
|
|
|
17117
16779
|
onInitiating: () => {
|
|
17118
16780
|
},
|
|
17119
16781
|
onDeviceCodeReady: (url, code, expiresIn) => {
|
|
17120
|
-
step.detail(`Copy code: ${
|
|
17121
|
-
step.detail(`Open: ${
|
|
17122
|
-
step.detail(
|
|
16782
|
+
step.detail(`Copy code: ${chalk75.cyan.bold(code)}`);
|
|
16783
|
+
step.detail(`Open: ${chalk75.cyan(url)}`);
|
|
16784
|
+
step.detail(chalk75.dim(`Expires in ${expiresIn} minutes`));
|
|
17123
16785
|
},
|
|
17124
16786
|
onPolling: () => {
|
|
17125
16787
|
},
|
|
@@ -17159,14 +16821,14 @@ async function handleModelProvider(ctx) {
|
|
|
17159
16821
|
const selectedChoice = choices.find((c24) => c24.type === providerType);
|
|
17160
16822
|
if (selectedChoice?.helpText) {
|
|
17161
16823
|
for (const line of selectedChoice.helpText.split("\n")) {
|
|
17162
|
-
step.detail(
|
|
16824
|
+
step.detail(chalk75.dim(line));
|
|
17163
16825
|
}
|
|
17164
16826
|
}
|
|
17165
16827
|
const secret = await step.prompt(
|
|
17166
16828
|
() => promptPassword(`Enter your ${selectedChoice?.secretLabel ?? "secret"}:`)
|
|
17167
16829
|
);
|
|
17168
16830
|
if (!secret) {
|
|
17169
|
-
console.log(
|
|
16831
|
+
console.log(chalk75.dim("Cancelled"));
|
|
17170
16832
|
process.exit(0);
|
|
17171
16833
|
}
|
|
17172
16834
|
let selectedModel;
|
|
@@ -17185,7 +16847,7 @@ async function handleModelProvider(ctx) {
|
|
|
17185
16847
|
() => promptSelect("Select model:", modelChoices)
|
|
17186
16848
|
);
|
|
17187
16849
|
if (modelSelection === void 0) {
|
|
17188
|
-
console.log(
|
|
16850
|
+
console.log(chalk75.dim("Cancelled"));
|
|
17189
16851
|
process.exit(0);
|
|
17190
16852
|
}
|
|
17191
16853
|
selectedModel = modelSelection === "" ? void 0 : modelSelection;
|
|
@@ -17195,7 +16857,7 @@ async function handleModelProvider(ctx) {
|
|
|
17195
16857
|
});
|
|
17196
16858
|
const modelNote = result.provider.selectedModel ? ` with model: ${result.provider.selectedModel}` : "";
|
|
17197
16859
|
step.detail(
|
|
17198
|
-
|
|
16860
|
+
chalk75.green(
|
|
17199
16861
|
`${providerType} ${result.created ? "created" : "updated"}${result.isDefault ? ` (default for ${result.framework})` : ""}${modelNote}`
|
|
17200
16862
|
)
|
|
17201
16863
|
);
|
|
@@ -17226,7 +16888,7 @@ async function handleAgentCreation(ctx) {
|
|
|
17226
16888
|
agentName = inputName;
|
|
17227
16889
|
if (existsSync12(agentName)) {
|
|
17228
16890
|
step.detail(
|
|
17229
|
-
|
|
16891
|
+
chalk75.yellow(`${agentName}/ already exists, choose another name`)
|
|
17230
16892
|
);
|
|
17231
16893
|
} else {
|
|
17232
16894
|
folderExists = false;
|
|
@@ -17247,7 +16909,7 @@ async function handleAgentCreation(ctx) {
|
|
|
17247
16909
|
}
|
|
17248
16910
|
}
|
|
17249
16911
|
await mkdir8(agentName, { recursive: true });
|
|
17250
|
-
step.detail(
|
|
16912
|
+
step.detail(chalk75.green(`Created ${agentName}/`));
|
|
17251
16913
|
});
|
|
17252
16914
|
return agentName;
|
|
17253
16915
|
}
|
|
@@ -17263,7 +16925,7 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
17263
16925
|
shouldInstall = confirmed ?? true;
|
|
17264
16926
|
}
|
|
17265
16927
|
if (!shouldInstall) {
|
|
17266
|
-
step.detail(
|
|
16928
|
+
step.detail(chalk75.dim("Skipped"));
|
|
17267
16929
|
return;
|
|
17268
16930
|
}
|
|
17269
16931
|
const scope = "project";
|
|
@@ -17271,7 +16933,7 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
17271
16933
|
const agentDir = `${process.cwd()}/${agentName}`;
|
|
17272
16934
|
const result = await installVm0Plugin(scope, agentDir);
|
|
17273
16935
|
step.detail(
|
|
17274
|
-
|
|
16936
|
+
chalk75.green(`Installed ${result.pluginId} (scope: ${result.scope})`)
|
|
17275
16937
|
);
|
|
17276
16938
|
pluginInstalled = true;
|
|
17277
16939
|
} catch (error) {
|
|
@@ -17282,14 +16944,14 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
17282
16944
|
}
|
|
17283
16945
|
function printNextSteps(agentName, pluginInstalled) {
|
|
17284
16946
|
console.log();
|
|
17285
|
-
console.log(
|
|
16947
|
+
console.log(chalk75.bold("Next step:"));
|
|
17286
16948
|
console.log();
|
|
17287
16949
|
if (pluginInstalled) {
|
|
17288
16950
|
console.log(
|
|
17289
|
-
` ${
|
|
16951
|
+
` ${chalk75.cyan(`cd ${agentName} && claude "/${PRIMARY_SKILL_NAME} let's build an agent"`)}`
|
|
17290
16952
|
);
|
|
17291
16953
|
} else {
|
|
17292
|
-
console.log(` ${
|
|
16954
|
+
console.log(` ${chalk75.cyan(`cd ${agentName} && vm0 init`)}`);
|
|
17293
16955
|
}
|
|
17294
16956
|
console.log();
|
|
17295
16957
|
}
|
|
@@ -17319,20 +16981,20 @@ var onboardCommand = new Command82().name("onboard").description("Guided setup f
|
|
|
17319
16981
|
|
|
17320
16982
|
// src/commands/setup-claude/index.ts
|
|
17321
16983
|
import { Command as Command83 } from "commander";
|
|
17322
|
-
import
|
|
16984
|
+
import chalk76 from "chalk";
|
|
17323
16985
|
var setupClaudeCommand = new Command83().name("setup-claude").description("Install VM0 Claude Plugin").option("--agent-dir <dir>", "Agent directory to run install in").option("--scope <scope>", "Installation scope (user or project)", "project").action(
|
|
17324
16986
|
withErrorHandler(async (options) => {
|
|
17325
|
-
console.log(
|
|
16987
|
+
console.log(chalk76.dim("Installing VM0 Claude Plugin..."));
|
|
17326
16988
|
const scope = options.scope === "user" ? "user" : "project";
|
|
17327
16989
|
const result = await installVm0Plugin(scope, options.agentDir);
|
|
17328
16990
|
console.log(
|
|
17329
|
-
|
|
16991
|
+
chalk76.green(`\u2713 Installed ${result.pluginId} (scope: ${result.scope})`)
|
|
17330
16992
|
);
|
|
17331
16993
|
console.log();
|
|
17332
16994
|
console.log("Next step:");
|
|
17333
16995
|
const cdPrefix = options.agentDir ? `cd ${options.agentDir} && ` : "";
|
|
17334
16996
|
console.log(
|
|
17335
|
-
|
|
16997
|
+
chalk76.cyan(
|
|
17336
16998
|
` ${cdPrefix}claude "/${PRIMARY_SKILL_NAME} let's build a workflow"`
|
|
17337
16999
|
)
|
|
17338
17000
|
);
|
|
@@ -17341,35 +17003,35 @@ var setupClaudeCommand = new Command83().name("setup-claude").description("Insta
|
|
|
17341
17003
|
|
|
17342
17004
|
// src/commands/dashboard/index.ts
|
|
17343
17005
|
import { Command as Command84 } from "commander";
|
|
17344
|
-
import
|
|
17006
|
+
import chalk77 from "chalk";
|
|
17345
17007
|
var dashboardCommand = new Command84().name("dashboard").description("Quick reference for common query commands").action(() => {
|
|
17346
17008
|
console.log();
|
|
17347
|
-
console.log(
|
|
17009
|
+
console.log(chalk77.bold("VM0 Dashboard"));
|
|
17348
17010
|
console.log();
|
|
17349
|
-
console.log(
|
|
17350
|
-
console.log(
|
|
17011
|
+
console.log(chalk77.bold("Agents"));
|
|
17012
|
+
console.log(chalk77.dim(" List agents: ") + "vm0 agent list");
|
|
17351
17013
|
console.log();
|
|
17352
|
-
console.log(
|
|
17353
|
-
console.log(
|
|
17354
|
-
console.log(
|
|
17014
|
+
console.log(chalk77.bold("Runs"));
|
|
17015
|
+
console.log(chalk77.dim(" Recent runs: ") + "vm0 run list");
|
|
17016
|
+
console.log(chalk77.dim(" View run logs: ") + "vm0 logs <run-id>");
|
|
17355
17017
|
console.log();
|
|
17356
|
-
console.log(
|
|
17357
|
-
console.log(
|
|
17018
|
+
console.log(chalk77.bold("Schedules"));
|
|
17019
|
+
console.log(chalk77.dim(" List schedules: ") + "vm0 schedule list");
|
|
17358
17020
|
console.log();
|
|
17359
|
-
console.log(
|
|
17360
|
-
console.log(
|
|
17361
|
-
console.log(
|
|
17362
|
-
console.log(
|
|
17021
|
+
console.log(chalk77.bold("Account"));
|
|
17022
|
+
console.log(chalk77.dim(" Usage stats: ") + "vm0 usage");
|
|
17023
|
+
console.log(chalk77.dim(" List secrets: ") + "vm0 secret list");
|
|
17024
|
+
console.log(chalk77.dim(" List variables: ") + "vm0 variable list");
|
|
17363
17025
|
console.log();
|
|
17364
17026
|
console.log(
|
|
17365
|
-
|
|
17027
|
+
chalk77.dim("Not logged in? Run: ") + chalk77.cyan("vm0 auth login")
|
|
17366
17028
|
);
|
|
17367
17029
|
console.log();
|
|
17368
17030
|
});
|
|
17369
17031
|
|
|
17370
17032
|
// src/commands/preference/index.ts
|
|
17371
17033
|
import { Command as Command85 } from "commander";
|
|
17372
|
-
import
|
|
17034
|
+
import chalk78 from "chalk";
|
|
17373
17035
|
function detectTimezone2() {
|
|
17374
17036
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
17375
17037
|
}
|
|
@@ -17390,15 +17052,15 @@ function parseOnOff(flag, value) {
|
|
|
17390
17052
|
);
|
|
17391
17053
|
}
|
|
17392
17054
|
function displayPreferences(prefs) {
|
|
17393
|
-
console.log(
|
|
17055
|
+
console.log(chalk78.bold("Current preferences:"));
|
|
17394
17056
|
console.log(
|
|
17395
|
-
` Timezone: ${prefs.timezone ?
|
|
17057
|
+
` Timezone: ${prefs.timezone ? chalk78.cyan(prefs.timezone) : chalk78.dim("not set")}`
|
|
17396
17058
|
);
|
|
17397
17059
|
console.log(
|
|
17398
|
-
` Email notify: ${prefs.notifyEmail ?
|
|
17060
|
+
` Email notify: ${prefs.notifyEmail ? chalk78.green("on") : chalk78.dim("off")}`
|
|
17399
17061
|
);
|
|
17400
17062
|
console.log(
|
|
17401
|
-
` Slack notify: ${prefs.notifySlack ?
|
|
17063
|
+
` Slack notify: ${prefs.notifySlack ? chalk78.green("on") : chalk78.dim("off")}`
|
|
17402
17064
|
);
|
|
17403
17065
|
}
|
|
17404
17066
|
function buildUpdates(opts) {
|
|
@@ -17428,21 +17090,21 @@ function buildUpdates(opts) {
|
|
|
17428
17090
|
function printUpdateResult(updates, result) {
|
|
17429
17091
|
if (updates.timezone !== void 0) {
|
|
17430
17092
|
console.log(
|
|
17431
|
-
|
|
17432
|
-
`Timezone set to ${
|
|
17093
|
+
chalk78.green(
|
|
17094
|
+
`Timezone set to ${chalk78.cyan(result.timezone ?? updates.timezone)}`
|
|
17433
17095
|
)
|
|
17434
17096
|
);
|
|
17435
17097
|
}
|
|
17436
17098
|
if (updates.notifyEmail !== void 0) {
|
|
17437
17099
|
console.log(
|
|
17438
|
-
|
|
17100
|
+
chalk78.green(
|
|
17439
17101
|
`Email notifications ${result.notifyEmail ? "enabled" : "disabled"}`
|
|
17440
17102
|
)
|
|
17441
17103
|
);
|
|
17442
17104
|
}
|
|
17443
17105
|
if (updates.notifySlack !== void 0) {
|
|
17444
17106
|
console.log(
|
|
17445
|
-
|
|
17107
|
+
chalk78.green(
|
|
17446
17108
|
`Slack notifications ${result.notifySlack ? "enabled" : "disabled"}`
|
|
17447
17109
|
)
|
|
17448
17110
|
);
|
|
@@ -17451,7 +17113,7 @@ function printUpdateResult(updates, result) {
|
|
|
17451
17113
|
async function interactiveSetup(prefs) {
|
|
17452
17114
|
if (!prefs.timezone) {
|
|
17453
17115
|
const detectedTz = detectTimezone2();
|
|
17454
|
-
console.log(
|
|
17116
|
+
console.log(chalk78.dim(`
|
|
17455
17117
|
System timezone detected: ${detectedTz}`));
|
|
17456
17118
|
const tz = await promptText(
|
|
17457
17119
|
"Set timezone? (enter timezone or leave empty to skip)",
|
|
@@ -17462,7 +17124,7 @@ System timezone detected: ${detectedTz}`));
|
|
|
17462
17124
|
throw new Error(`Invalid timezone: ${tz.trim()}`);
|
|
17463
17125
|
}
|
|
17464
17126
|
await updateUserPreferences({ timezone: tz.trim() });
|
|
17465
|
-
console.log(
|
|
17127
|
+
console.log(chalk78.green(`Timezone set to ${chalk78.cyan(tz.trim())}`));
|
|
17466
17128
|
}
|
|
17467
17129
|
}
|
|
17468
17130
|
if (!prefs.notifyEmail) {
|
|
@@ -17472,7 +17134,7 @@ System timezone detected: ${detectedTz}`));
|
|
|
17472
17134
|
);
|
|
17473
17135
|
if (enable) {
|
|
17474
17136
|
await updateUserPreferences({ notifyEmail: true });
|
|
17475
|
-
console.log(
|
|
17137
|
+
console.log(chalk78.green("Email notifications enabled"));
|
|
17476
17138
|
}
|
|
17477
17139
|
}
|
|
17478
17140
|
}
|
|
@@ -17491,10 +17153,10 @@ var preferenceCommand = new Command85().name("preference").description("View or
|
|
|
17491
17153
|
} else if (!prefs.timezone) {
|
|
17492
17154
|
console.log();
|
|
17493
17155
|
console.log(
|
|
17494
|
-
`To set timezone: ${
|
|
17156
|
+
`To set timezone: ${chalk78.cyan("vm0 preference --timezone <timezone>")}`
|
|
17495
17157
|
);
|
|
17496
17158
|
console.log(
|
|
17497
|
-
|
|
17159
|
+
chalk78.dim("Example: vm0 preference --timezone America/New_York")
|
|
17498
17160
|
);
|
|
17499
17161
|
}
|
|
17500
17162
|
})
|
|
@@ -17502,7 +17164,7 @@ var preferenceCommand = new Command85().name("preference").description("View or
|
|
|
17502
17164
|
|
|
17503
17165
|
// src/commands/upgrade/index.ts
|
|
17504
17166
|
import { Command as Command86 } from "commander";
|
|
17505
|
-
import
|
|
17167
|
+
import chalk79 from "chalk";
|
|
17506
17168
|
var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CLI to the latest version").action(
|
|
17507
17169
|
withErrorHandler(async () => {
|
|
17508
17170
|
console.log("Checking for updates...");
|
|
@@ -17510,13 +17172,13 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17510
17172
|
if (latestVersion === null) {
|
|
17511
17173
|
throw new Error("Could not check for updates. Please try again later.");
|
|
17512
17174
|
}
|
|
17513
|
-
if (latestVersion === "9.62.
|
|
17514
|
-
console.log(
|
|
17175
|
+
if (latestVersion === "9.62.2") {
|
|
17176
|
+
console.log(chalk79.green(`\u2713 Already up to date (${"9.62.2"})`));
|
|
17515
17177
|
return;
|
|
17516
17178
|
}
|
|
17517
17179
|
console.log(
|
|
17518
|
-
|
|
17519
|
-
`Current version: ${"9.62.
|
|
17180
|
+
chalk79.yellow(
|
|
17181
|
+
`Current version: ${"9.62.2"} -> Latest version: ${latestVersion}`
|
|
17520
17182
|
)
|
|
17521
17183
|
);
|
|
17522
17184
|
console.log();
|
|
@@ -17524,26 +17186,26 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17524
17186
|
if (!isAutoUpgradeSupported(packageManager)) {
|
|
17525
17187
|
if (packageManager === "unknown") {
|
|
17526
17188
|
console.log(
|
|
17527
|
-
|
|
17189
|
+
chalk79.yellow(
|
|
17528
17190
|
"Could not detect your package manager for auto-upgrade."
|
|
17529
17191
|
)
|
|
17530
17192
|
);
|
|
17531
17193
|
} else {
|
|
17532
17194
|
console.log(
|
|
17533
|
-
|
|
17195
|
+
chalk79.yellow(
|
|
17534
17196
|
`Auto-upgrade is not supported for ${packageManager}.`
|
|
17535
17197
|
)
|
|
17536
17198
|
);
|
|
17537
17199
|
}
|
|
17538
|
-
console.log(
|
|
17539
|
-
console.log(
|
|
17200
|
+
console.log(chalk79.yellow("Please upgrade manually:"));
|
|
17201
|
+
console.log(chalk79.cyan(` ${getManualUpgradeCommand(packageManager)}`));
|
|
17540
17202
|
return;
|
|
17541
17203
|
}
|
|
17542
17204
|
console.log(`Upgrading via ${packageManager}...`);
|
|
17543
17205
|
const success = await performUpgrade(packageManager);
|
|
17544
17206
|
if (success) {
|
|
17545
17207
|
console.log(
|
|
17546
|
-
|
|
17208
|
+
chalk79.green(`\u2713 Upgraded from ${"9.62.2"} to ${latestVersion}`)
|
|
17547
17209
|
);
|
|
17548
17210
|
return;
|
|
17549
17211
|
}
|
|
@@ -17557,7 +17219,7 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17557
17219
|
|
|
17558
17220
|
// src/index.ts
|
|
17559
17221
|
var program = new Command87();
|
|
17560
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.62.
|
|
17222
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.62.2");
|
|
17561
17223
|
program.addCommand(authCommand);
|
|
17562
17224
|
program.addCommand(infoCommand);
|
|
17563
17225
|
program.addCommand(composeCommand);
|