@ganakailabs/cloudeval-cli 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-7ZEWM5DC.js → App-G6ACKT3M.js} +6 -6
- package/dist/{Banner-Z2XN5FGK.js → Banner-UIKOHSAV.js} +2 -2
- package/dist/{Onboarding-4N4WIORR.js → Onboarding-QUB2SCWP.js} +2 -2
- package/dist/{chunk-TTE5NEMA.js → chunk-5BLEZWMN.js} +1 -1
- package/dist/{chunk-LDDHLUZH.js → chunk-DLACXFC6.js} +71 -4
- package/dist/{chunk-Q5D5HYWW.js → chunk-LVR2XXJK.js} +1 -1
- package/dist/{chunk-AF6Z5VZD.js → chunk-Y6LNVH7K.js} +1 -1
- package/dist/cli.js +271 -62
- package/dist/{dist-AGQQPJUD.js → dist-AS6Z6RQQ.js} +1 -1
- package/package.json +1 -1
- package/sbom.spdx.json +1 -1
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-RCRNSEQS.js";
|
|
9
9
|
import {
|
|
10
10
|
Onboarding
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LVR2XXJK.js";
|
|
12
12
|
import {
|
|
13
13
|
checkUserStatus,
|
|
14
14
|
completeActiveAssistantMessage,
|
|
@@ -35,13 +35,13 @@ import {
|
|
|
35
35
|
reduceChunk,
|
|
36
36
|
runReports,
|
|
37
37
|
streamChat
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-DLACXFC6.js";
|
|
39
39
|
import {
|
|
40
40
|
Banner
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-5BLEZWMN.js";
|
|
42
42
|
import {
|
|
43
43
|
CLI_VERSION
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-Y6LNVH7K.js";
|
|
45
45
|
import {
|
|
46
46
|
raisedButtonStyle,
|
|
47
47
|
terminalTheme
|
|
@@ -5850,7 +5850,7 @@ var getUserIdentityFromToken = async (token) => {
|
|
|
5850
5850
|
return { name: "You" };
|
|
5851
5851
|
}
|
|
5852
5852
|
try {
|
|
5853
|
-
const { extractEmailFromToken } = await import("./dist-
|
|
5853
|
+
const { extractEmailFromToken } = await import("./dist-AS6Z6RQQ.js");
|
|
5854
5854
|
const email = extractEmailFromToken(token) ?? void 0;
|
|
5855
5855
|
return {
|
|
5856
5856
|
name: getFirstNameForDisplay({ email }),
|
|
@@ -7285,7 +7285,7 @@ var App = ({
|
|
|
7285
7285
|
setIsLoggingIn(true);
|
|
7286
7286
|
setLoaderStep(1);
|
|
7287
7287
|
try {
|
|
7288
|
-
const { login } = await import("./dist-
|
|
7288
|
+
const { login } = await import("./dist-AS6Z6RQQ.js");
|
|
7289
7289
|
const newToken = await login(baseUrl, {
|
|
7290
7290
|
headless: Boolean(process.env.SSH_TTY || process.env.CI)
|
|
7291
7291
|
});
|
|
@@ -3257,8 +3257,11 @@ var buildQuickProjectPayload = (input) => {
|
|
|
3257
3257
|
if (!providerValues.has(provider)) {
|
|
3258
3258
|
throw new Error(`Unsupported cloud provider '${provider}'.`);
|
|
3259
3259
|
}
|
|
3260
|
+
if (input.cloudSync && provider !== "azure") {
|
|
3261
|
+
throw new Error("Cloud sync project creation currently supports Azure only.");
|
|
3262
|
+
}
|
|
3260
3263
|
const name = input.name?.trim() || inferred?.suggestedName || "Quick Project";
|
|
3261
|
-
const description = input.description?.trim() || inferred?.suggestedDescription || `Template project for ${name}
|
|
3264
|
+
const description = input.description?.trim() || inferred?.suggestedDescription || (input.cloudSync ? `Cloud sync project for ${name}` : `Template project for ${name}`);
|
|
3262
3265
|
const connection = {
|
|
3263
3266
|
user_id: input.userId,
|
|
3264
3267
|
name: `${name} Connection`,
|
|
@@ -3302,6 +3305,45 @@ var responseJson = async (response, label) => {
|
|
|
3302
3305
|
return await response.json();
|
|
3303
3306
|
};
|
|
3304
3307
|
var appendConnectionBody = (payload, input) => {
|
|
3308
|
+
if (input.cloudSync) {
|
|
3309
|
+
return JSON.stringify({
|
|
3310
|
+
...payload,
|
|
3311
|
+
subscription_id: input.cloudSync.subscriptionId,
|
|
3312
|
+
target_resource_groups: input.cloudSync.resourceGroups ?? [],
|
|
3313
|
+
credentials: {
|
|
3314
|
+
tenant_id: input.cloudSync.tenantId,
|
|
3315
|
+
client_id: input.cloudSync.clientId,
|
|
3316
|
+
client_secret: input.cloudSync.clientSecret,
|
|
3317
|
+
subscription_id: input.cloudSync.subscriptionId
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3321
|
+
if (input.workspaceFiles?.length) {
|
|
3322
|
+
const entryPath = input.workspaceEntry || input.workspaceFiles[0]?.path;
|
|
3323
|
+
const entry = input.workspaceFiles.find((file) => file.path === entryPath);
|
|
3324
|
+
if (!entry) {
|
|
3325
|
+
throw new Error(`Workspace entry file '${entryPath}' was not found.`);
|
|
3326
|
+
}
|
|
3327
|
+
const formData2 = new FormData();
|
|
3328
|
+
formData2.append("user_id", payload.user_id);
|
|
3329
|
+
formData2.append("name", payload.name);
|
|
3330
|
+
formData2.append("cloud_provider", payload.cloud_provider);
|
|
3331
|
+
formData2.append("description", payload.description);
|
|
3332
|
+
formData2.append("type", payload.type);
|
|
3333
|
+
formData2.append("auto_sync", String(payload.auto_sync ?? true));
|
|
3334
|
+
formData2.append("visualization_source_path", entry.path);
|
|
3335
|
+
formData2.append("template_file", entry.blob, entry.path);
|
|
3336
|
+
const workspaceFilePaths = [];
|
|
3337
|
+
for (const file of input.workspaceFiles) {
|
|
3338
|
+
if (file.path === entry.path) {
|
|
3339
|
+
continue;
|
|
3340
|
+
}
|
|
3341
|
+
workspaceFilePaths.push(file.path);
|
|
3342
|
+
formData2.append("workspace_files", file.blob, file.path);
|
|
3343
|
+
}
|
|
3344
|
+
formData2.append("workspace_file_paths", JSON.stringify(workspaceFilePaths));
|
|
3345
|
+
return formData2;
|
|
3346
|
+
}
|
|
3305
3347
|
if (!input.templateFile && !input.parametersFile) {
|
|
3306
3348
|
return JSON.stringify(payload);
|
|
3307
3349
|
}
|
|
@@ -3339,10 +3381,16 @@ var headersForBody = (authToken, body) => {
|
|
|
3339
3381
|
return getCLIHeaders(authToken);
|
|
3340
3382
|
};
|
|
3341
3383
|
var createQuickProject = async (input) => {
|
|
3342
|
-
if (!input.templateUrl && !input.templateFile) {
|
|
3343
|
-
throw new Error("Provide --template-url or --
|
|
3384
|
+
if (!input.templateUrl && !input.templateFile && !input.workspaceFiles?.length && !input.cloudSync) {
|
|
3385
|
+
throw new Error("Provide --template-url, --template-file, --workspace-dir, or --cloud-sync.");
|
|
3344
3386
|
}
|
|
3345
3387
|
const built = buildQuickProjectPayload(input);
|
|
3388
|
+
if (input.cloudSync) {
|
|
3389
|
+
built.connection.type = "sync";
|
|
3390
|
+
built.connection.auto_sync = true;
|
|
3391
|
+
built.project.type = "sync";
|
|
3392
|
+
built.project.report_config.include_cost_forecast = true;
|
|
3393
|
+
}
|
|
3346
3394
|
const apiBase = normalizeApiBase(input.baseUrl);
|
|
3347
3395
|
const connectionBody = appendConnectionBody(built.connection, input);
|
|
3348
3396
|
const connection = await responseJson(
|
|
@@ -3369,12 +3417,31 @@ var createQuickProject = async (input) => {
|
|
|
3369
3417
|
}),
|
|
3370
3418
|
"Project creation"
|
|
3371
3419
|
);
|
|
3420
|
+
let iacPipeline;
|
|
3421
|
+
if (input.workspaceFiles?.length) {
|
|
3422
|
+
iacPipeline = await responseJson(
|
|
3423
|
+
await fetch(
|
|
3424
|
+
`${apiBase}/projects/${encodeURIComponent(String(project.id))}/iac/pipeline?user_id=${encodeURIComponent(input.userId)}`,
|
|
3425
|
+
{
|
|
3426
|
+
method: "POST",
|
|
3427
|
+
headers: withIdempotencyHeader(getCLIHeaders(input.authToken)),
|
|
3428
|
+
body: JSON.stringify({
|
|
3429
|
+
import_request: { source: "connection", connection_id: connectionId },
|
|
3430
|
+
resolve: true,
|
|
3431
|
+
refresh_analysis: true
|
|
3432
|
+
})
|
|
3433
|
+
}
|
|
3434
|
+
),
|
|
3435
|
+
"IaC pipeline"
|
|
3436
|
+
);
|
|
3437
|
+
}
|
|
3372
3438
|
return {
|
|
3373
3439
|
project,
|
|
3374
3440
|
connection,
|
|
3375
3441
|
syncStatus: connection.sync_status ?? connection.sync_job ?? null,
|
|
3376
3442
|
normalizedTemplateUrl: built.normalizedTemplateUrl,
|
|
3377
|
-
inferred: built.inferred
|
|
3443
|
+
inferred: built.inferred,
|
|
3444
|
+
iacPipeline
|
|
3378
3445
|
};
|
|
3379
3446
|
};
|
|
3380
3447
|
var listConnections = async (options) => {
|
package/dist/cli.js
CHANGED
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
normalizeApiBase,
|
|
34
34
|
redactSensitiveSecrets,
|
|
35
35
|
redactSensitiveText
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-DLACXFC6.js";
|
|
37
37
|
import {
|
|
38
38
|
CLI_VERSION
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-Y6LNVH7K.js";
|
|
40
40
|
|
|
41
41
|
// src/runtime/prepareInk.ts
|
|
42
42
|
import fs from "fs";
|
|
@@ -507,6 +507,16 @@ var cliCommands = [
|
|
|
507
507
|
"--template-file",
|
|
508
508
|
"--parameters-file",
|
|
509
509
|
"--parameters-url",
|
|
510
|
+
"--workspace-dir",
|
|
511
|
+
"--workspace-entry",
|
|
512
|
+
"--workspace-parameters",
|
|
513
|
+
"--cloud-sync",
|
|
514
|
+
"--azure-tenant-id",
|
|
515
|
+
"--azure-client-id",
|
|
516
|
+
"--azure-client-secret",
|
|
517
|
+
"--azure-subscription-id",
|
|
518
|
+
"--resource-group",
|
|
519
|
+
"--resource-groups",
|
|
510
520
|
"--name",
|
|
511
521
|
"--description",
|
|
512
522
|
"--provider",
|
|
@@ -1604,7 +1614,7 @@ var resolveReportProjectId = async ({
|
|
|
1604
1614
|
if (!token) {
|
|
1605
1615
|
throw new Error("No project specified. Use --project <id> for report access.");
|
|
1606
1616
|
}
|
|
1607
|
-
const resolvedWorkspace = workspace ?? await import("./dist-
|
|
1617
|
+
const resolvedWorkspace = workspace ?? await import("./dist-AS6Z6RQQ.js").then((core) => ({
|
|
1608
1618
|
checkUserStatus: core.checkUserStatus,
|
|
1609
1619
|
getProjects: core.getProjects
|
|
1610
1620
|
}));
|
|
@@ -1633,7 +1643,7 @@ var warnIfAccessKeyFromCliOption = (options, command) => {
|
|
|
1633
1643
|
};
|
|
1634
1644
|
var resolveAuthContext = async (options, command, deps) => {
|
|
1635
1645
|
const baseUrl = await deps.resolveBaseUrl(options, command);
|
|
1636
|
-
const core = await import("./dist-
|
|
1646
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
1637
1647
|
core.assertSecureBaseUrl(baseUrl);
|
|
1638
1648
|
warnIfAccessKeyFromCliOption(options, command);
|
|
1639
1649
|
let accessKey = options.accessKey;
|
|
@@ -1719,7 +1729,7 @@ var resolveToken = async (options, baseUrl, deps, command) => {
|
|
|
1719
1729
|
if (options.accessKey) {
|
|
1720
1730
|
return options.accessKey;
|
|
1721
1731
|
}
|
|
1722
|
-
const { getAuthToken } = await import("./dist-
|
|
1732
|
+
const { getAuthToken } = await import("./dist-AS6Z6RQQ.js");
|
|
1723
1733
|
try {
|
|
1724
1734
|
return await getAuthToken({
|
|
1725
1735
|
accessKey: options.accessKey,
|
|
@@ -1730,7 +1740,7 @@ var resolveToken = async (options, baseUrl, deps, command) => {
|
|
|
1730
1740
|
if (!canLogin) {
|
|
1731
1741
|
throw error;
|
|
1732
1742
|
}
|
|
1733
|
-
const { login } = await import("./dist-
|
|
1743
|
+
const { login } = await import("./dist-AS6Z6RQQ.js");
|
|
1734
1744
|
process.stderr.write("Authentication required. Starting login flow...\n");
|
|
1735
1745
|
const token = await login(baseUrl, {
|
|
1736
1746
|
headless: Boolean(process.env.SSH_TTY || process.env.CLOUDEVAL_HEADLESS_LOGIN)
|
|
@@ -1896,7 +1906,7 @@ var registerReportsCommand = (program2, deps) => {
|
|
|
1896
1906
|
token,
|
|
1897
1907
|
requestedProjectId: options.project
|
|
1898
1908
|
});
|
|
1899
|
-
const core = await import("./dist-
|
|
1909
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
1900
1910
|
const status = token ? await core.checkUserStatus(baseUrl, token) : void 0;
|
|
1901
1911
|
const reports2 = await core.listReports({
|
|
1902
1912
|
baseUrl,
|
|
@@ -1918,7 +1928,7 @@ var registerReportsCommand = (program2, deps) => {
|
|
|
1918
1928
|
try {
|
|
1919
1929
|
const baseUrl = await deps.resolveBaseUrl(options, command);
|
|
1920
1930
|
const token = await resolveToken(options, baseUrl, deps, command);
|
|
1921
|
-
const core = await import("./dist-
|
|
1931
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
1922
1932
|
const status = token ? await core.checkUserStatus(baseUrl, token) : void 0;
|
|
1923
1933
|
const projectId = await resolveReportProjectId({
|
|
1924
1934
|
baseUrl,
|
|
@@ -2021,7 +2031,7 @@ var registerReportsCommand = (program2, deps) => {
|
|
|
2021
2031
|
try {
|
|
2022
2032
|
const baseUrl = await deps.resolveBaseUrl(options, command);
|
|
2023
2033
|
const token = await resolveToken(options, baseUrl, deps, command);
|
|
2024
|
-
const core = await import("./dist-
|
|
2034
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
2025
2035
|
const status = token ? await core.checkUserStatus(baseUrl, token) : void 0;
|
|
2026
2036
|
const projectId = await resolveReportProjectId({
|
|
2027
2037
|
baseUrl,
|
|
@@ -2091,7 +2101,7 @@ var registerReportsCommand = (program2, deps) => {
|
|
|
2091
2101
|
token,
|
|
2092
2102
|
requestedProjectId: options.project
|
|
2093
2103
|
});
|
|
2094
|
-
const core = await import("./dist-
|
|
2104
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
2095
2105
|
const status = token ? await core.checkUserStatus(baseUrl, token) : void 0;
|
|
2096
2106
|
const report = await core.getWafReport({
|
|
2097
2107
|
baseUrl,
|
|
@@ -2130,7 +2140,7 @@ var registerReportsCommand = (program2, deps) => {
|
|
|
2130
2140
|
token,
|
|
2131
2141
|
requestedProjectId: options.project
|
|
2132
2142
|
});
|
|
2133
|
-
const core = await import("./dist-
|
|
2143
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
2134
2144
|
const status = token ? await core.checkUserStatus(baseUrl, token) : void 0;
|
|
2135
2145
|
const report = await core.getReport({
|
|
2136
2146
|
baseUrl,
|
|
@@ -2158,7 +2168,7 @@ var registerReportsCommand = (program2, deps) => {
|
|
|
2158
2168
|
token,
|
|
2159
2169
|
requestedProjectId: options.project
|
|
2160
2170
|
});
|
|
2161
|
-
const core = await import("./dist-
|
|
2171
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
2162
2172
|
const status = token ? await core.checkUserStatus(baseUrl, token) : void 0;
|
|
2163
2173
|
const report = await core.getCostReport({
|
|
2164
2174
|
baseUrl,
|
|
@@ -2187,7 +2197,7 @@ var registerReportsCommand = (program2, deps) => {
|
|
|
2187
2197
|
token,
|
|
2188
2198
|
requestedProjectId: options.project
|
|
2189
2199
|
});
|
|
2190
|
-
const core = await import("./dist-
|
|
2200
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
2191
2201
|
const status = token ? await core.checkUserStatus(baseUrl, token) : void 0;
|
|
2192
2202
|
const report = await core.getWafReport({
|
|
2193
2203
|
baseUrl,
|
|
@@ -3529,7 +3539,7 @@ var runChatRecipe = async (recipe, prompt2, options, command, deps) => {
|
|
|
3529
3539
|
});
|
|
3530
3540
|
progressWriter.write({ type: "auth", step: "auth", message: "Resolving authentication" });
|
|
3531
3541
|
const context = await resolveAuthContext(options, command, deps);
|
|
3532
|
-
const core = await import("./dist-
|
|
3542
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
3533
3543
|
progressWriter.write({
|
|
3534
3544
|
type: "request",
|
|
3535
3545
|
step: "project",
|
|
@@ -4640,6 +4650,198 @@ var fileBlob = async (filePath) => {
|
|
|
4640
4650
|
name: path3.basename(filePath)
|
|
4641
4651
|
};
|
|
4642
4652
|
};
|
|
4653
|
+
var normalizeWorkspacePath = (value) => value.replace(/\\/g, "/").replace(/^\/+/, "").replace(/^\.\//, "").split("/").filter((part) => part && part !== ".").join("/");
|
|
4654
|
+
var isIgnoredWorkspacePath = (relativePath) => {
|
|
4655
|
+
const normalized = normalizeWorkspacePath(relativePath);
|
|
4656
|
+
return normalized === ".DS_Store" || normalized.endsWith("/.DS_Store") || normalized.startsWith(".git/") || normalized.startsWith("node_modules/") || normalized.startsWith(".cloudeval/bundles/") || normalized.startsWith(".cloudeval/connections/") || normalized.startsWith(".cloudeval/reports/") || normalized.startsWith(".cloudeval/share/") || normalized.startsWith(".cloudeval/shares/") || normalized.startsWith(".cloudeval/snapshots/") || normalized.startsWith(".cloudeval/template-cache/") || normalized === ".cloudeval/ps-rule.yaml";
|
|
4657
|
+
};
|
|
4658
|
+
var readWorkspaceConfig = (content) => {
|
|
4659
|
+
const entryMatch = content.match(/^\s*entry:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/m);
|
|
4660
|
+
const parametersMatch = content.match(
|
|
4661
|
+
/^\s*parameters:\s*["']?([^"'\n#]+)["']?\s*(?:#.*)?$/m
|
|
4662
|
+
);
|
|
4663
|
+
return {
|
|
4664
|
+
entry: entryMatch ? normalizeWorkspacePath(entryMatch[1].trim()) : void 0,
|
|
4665
|
+
parameters: parametersMatch ? normalizeWorkspacePath(parametersMatch[1].trim()) : void 0
|
|
4666
|
+
};
|
|
4667
|
+
};
|
|
4668
|
+
var generateWorkspaceConfig = (entry, parameters) => {
|
|
4669
|
+
const parameterLine = parameters ? ` parameters: ${parameters}
|
|
4670
|
+
` : "";
|
|
4671
|
+
return [
|
|
4672
|
+
"version: 1",
|
|
4673
|
+
"stacks:",
|
|
4674
|
+
" - id: main",
|
|
4675
|
+
` entry: ${entry}`,
|
|
4676
|
+
parameterLine.trimEnd(),
|
|
4677
|
+
"resolve:",
|
|
4678
|
+
" linked_templates: true",
|
|
4679
|
+
"analysis:",
|
|
4680
|
+
" auto_resolve_on_import: true",
|
|
4681
|
+
" auto_refresh_on_resolve: true",
|
|
4682
|
+
""
|
|
4683
|
+
].filter((line) => line.length > 0).join("\n");
|
|
4684
|
+
};
|
|
4685
|
+
var collectWorkspacePaths = async (root) => {
|
|
4686
|
+
const paths = [];
|
|
4687
|
+
const visit = async (directory) => {
|
|
4688
|
+
const entries = await fs5.readdir(directory, { withFileTypes: true });
|
|
4689
|
+
for (const entry of entries) {
|
|
4690
|
+
const absolute = path3.join(directory, entry.name);
|
|
4691
|
+
const relative = normalizeWorkspacePath(path3.relative(root, absolute));
|
|
4692
|
+
if (!relative || isIgnoredWorkspacePath(relative)) {
|
|
4693
|
+
continue;
|
|
4694
|
+
}
|
|
4695
|
+
if (entry.isDirectory()) {
|
|
4696
|
+
await visit(absolute);
|
|
4697
|
+
} else if (entry.isFile()) {
|
|
4698
|
+
paths.push(relative);
|
|
4699
|
+
}
|
|
4700
|
+
}
|
|
4701
|
+
};
|
|
4702
|
+
await visit(root);
|
|
4703
|
+
return paths.sort((left, right) => left.localeCompare(right));
|
|
4704
|
+
};
|
|
4705
|
+
var findFirstPath = (paths, candidates) => {
|
|
4706
|
+
const lowerToPath = new Map(paths.map((filePath) => [filePath.toLowerCase(), filePath]));
|
|
4707
|
+
for (const candidate of candidates) {
|
|
4708
|
+
const found = lowerToPath.get(candidate.toLowerCase());
|
|
4709
|
+
if (found) {
|
|
4710
|
+
return found;
|
|
4711
|
+
}
|
|
4712
|
+
}
|
|
4713
|
+
return void 0;
|
|
4714
|
+
};
|
|
4715
|
+
var detectWorkspaceEntry = (paths, explicitEntry, config) => {
|
|
4716
|
+
if (explicitEntry) {
|
|
4717
|
+
const normalized = normalizeWorkspacePath(explicitEntry);
|
|
4718
|
+
if (!paths.includes(normalized)) {
|
|
4719
|
+
throw new Error(`--workspace-entry '${explicitEntry}' was not found in --workspace-dir.`);
|
|
4720
|
+
}
|
|
4721
|
+
return normalized;
|
|
4722
|
+
}
|
|
4723
|
+
if (config?.entry && paths.includes(config.entry)) {
|
|
4724
|
+
return config.entry;
|
|
4725
|
+
}
|
|
4726
|
+
const rootCandidate = findFirstPath(paths, ["azuredeploy.json", "main.json", "deploy.json"]);
|
|
4727
|
+
if (rootCandidate) {
|
|
4728
|
+
return rootCandidate;
|
|
4729
|
+
}
|
|
4730
|
+
const recursiveAzureDeploy = paths.find(
|
|
4731
|
+
(filePath) => /(^|\/)azuredeploy\.json$/i.test(filePath)
|
|
4732
|
+
);
|
|
4733
|
+
if (recursiveAzureDeploy) {
|
|
4734
|
+
return recursiveAzureDeploy;
|
|
4735
|
+
}
|
|
4736
|
+
const armCandidate = paths.find((filePath) => /\.json$/i.test(filePath));
|
|
4737
|
+
if (armCandidate) {
|
|
4738
|
+
return armCandidate;
|
|
4739
|
+
}
|
|
4740
|
+
throw new Error(
|
|
4741
|
+
"Could not detect a workspace entry file. Pass --workspace-entry or add .cloudeval/config.yaml."
|
|
4742
|
+
);
|
|
4743
|
+
};
|
|
4744
|
+
var resolveWorkspaceParameters = (paths, explicitParameters, config) => {
|
|
4745
|
+
if (explicitParameters) {
|
|
4746
|
+
const normalized = normalizeWorkspacePath(explicitParameters);
|
|
4747
|
+
if (!paths.includes(normalized)) {
|
|
4748
|
+
throw new Error(`--workspace-parameters '${explicitParameters}' was not found in --workspace-dir.`);
|
|
4749
|
+
}
|
|
4750
|
+
return normalized;
|
|
4751
|
+
}
|
|
4752
|
+
if (config?.parameters && paths.includes(config.parameters)) {
|
|
4753
|
+
return config.parameters;
|
|
4754
|
+
}
|
|
4755
|
+
return findFirstPath(paths, ["azuredeploy.parameters.json", "parameters.json"]);
|
|
4756
|
+
};
|
|
4757
|
+
var collectWorkspaceFiles = async (workspaceDir, options) => {
|
|
4758
|
+
const root = path3.resolve(workspaceDir);
|
|
4759
|
+
const stat = await fs5.stat(root).catch(() => void 0);
|
|
4760
|
+
if (!stat?.isDirectory()) {
|
|
4761
|
+
throw new Error(`--workspace-dir '${workspaceDir}' is not a directory.`);
|
|
4762
|
+
}
|
|
4763
|
+
const paths = await collectWorkspacePaths(root);
|
|
4764
|
+
const existingConfigPath = paths.find(
|
|
4765
|
+
(filePath) => filePath.toLowerCase() === ".cloudeval/config.yaml"
|
|
4766
|
+
);
|
|
4767
|
+
const config = existingConfigPath ? readWorkspaceConfig(await fs5.readFile(path3.join(root, existingConfigPath), "utf8")) : void 0;
|
|
4768
|
+
const entry = detectWorkspaceEntry(paths, options.workspaceEntry, config);
|
|
4769
|
+
const parameters = resolveWorkspaceParameters(paths, options.workspaceParameters, config);
|
|
4770
|
+
const finalPaths = [...paths];
|
|
4771
|
+
const generatedConfig = existingConfigPath ? void 0 : generateWorkspaceConfig(entry, parameters);
|
|
4772
|
+
if (generatedConfig) {
|
|
4773
|
+
finalPaths.push(".cloudeval/config.yaml");
|
|
4774
|
+
}
|
|
4775
|
+
const files = [];
|
|
4776
|
+
for (const relativePath of finalPaths.sort((left, right) => left.localeCompare(right))) {
|
|
4777
|
+
if (relativePath === ".cloudeval/config.yaml" && generatedConfig) {
|
|
4778
|
+
files.push({
|
|
4779
|
+
path: relativePath,
|
|
4780
|
+
blob: new Blob([generatedConfig], { type: "text/yaml" })
|
|
4781
|
+
});
|
|
4782
|
+
continue;
|
|
4783
|
+
}
|
|
4784
|
+
const bytes = await fs5.readFile(path3.join(root, relativePath));
|
|
4785
|
+
files.push({
|
|
4786
|
+
path: relativePath,
|
|
4787
|
+
blob: new Blob([bytes], {
|
|
4788
|
+
type: /\.ya?ml$/i.test(relativePath) ? "text/yaml" : "application/octet-stream"
|
|
4789
|
+
})
|
|
4790
|
+
});
|
|
4791
|
+
}
|
|
4792
|
+
return { files, entry };
|
|
4793
|
+
};
|
|
4794
|
+
var collectResourceGroups = (options) => {
|
|
4795
|
+
const repeated = Array.isArray(options.resourceGroup) ? options.resourceGroup : [];
|
|
4796
|
+
const commaSeparated = options.resourceGroups ? options.resourceGroups.split(",").map((value) => value.trim()) : [];
|
|
4797
|
+
return [...repeated, ...commaSeparated].map((value) => value.trim()).filter(Boolean);
|
|
4798
|
+
};
|
|
4799
|
+
var resolveAzureCloudSyncInput = (options) => {
|
|
4800
|
+
if (!options.cloudSync) {
|
|
4801
|
+
return void 0;
|
|
4802
|
+
}
|
|
4803
|
+
const tenantId = options.azureTenantId || process.env.AZURE_TENANT_ID;
|
|
4804
|
+
const clientId = options.azureClientId || process.env.AZURE_CLIENT_ID;
|
|
4805
|
+
const clientSecret = options.azureClientSecret || process.env.AZURE_CLIENT_SECRET;
|
|
4806
|
+
const subscriptionId = options.azureSubscriptionId || process.env.AZURE_SUBSCRIPTION_ID;
|
|
4807
|
+
const missing = [
|
|
4808
|
+
["--azure-tenant-id or AZURE_TENANT_ID", tenantId],
|
|
4809
|
+
["--azure-client-id or AZURE_CLIENT_ID", clientId],
|
|
4810
|
+
["--azure-client-secret or AZURE_CLIENT_SECRET", clientSecret],
|
|
4811
|
+
["--azure-subscription-id or AZURE_SUBSCRIPTION_ID", subscriptionId]
|
|
4812
|
+
].filter(([, value]) => !value).map(([label]) => label);
|
|
4813
|
+
if (missing.length) {
|
|
4814
|
+
throw new Error(`Missing Cloud sync credential value(s): ${missing.join(", ")}.`);
|
|
4815
|
+
}
|
|
4816
|
+
return {
|
|
4817
|
+
tenantId,
|
|
4818
|
+
clientId,
|
|
4819
|
+
clientSecret,
|
|
4820
|
+
subscriptionId,
|
|
4821
|
+
resourceGroups: collectResourceGroups(options)
|
|
4822
|
+
};
|
|
4823
|
+
};
|
|
4824
|
+
var assertSingleProjectSource = (options) => {
|
|
4825
|
+
const sources = [
|
|
4826
|
+
options.templateUrl ? "--template-url" : void 0,
|
|
4827
|
+
options.templateFile ? "--template-file" : void 0,
|
|
4828
|
+
options.workspaceDir ? "--workspace-dir" : void 0,
|
|
4829
|
+
options.cloudSync ? "--cloud-sync" : void 0
|
|
4830
|
+
].filter(Boolean);
|
|
4831
|
+
if (sources.length > 1) {
|
|
4832
|
+
throw new Error(`Choose one project source: ${sources.join(", ")} cannot be combined.`);
|
|
4833
|
+
}
|
|
4834
|
+
if ((options.parametersFile || options.parametersUrl) && !options.templateFile && !options.templateUrl) {
|
|
4835
|
+
throw new Error("--parameters-file and --parameters-url require --template-file or --template-url.");
|
|
4836
|
+
}
|
|
4837
|
+
if (options.cloudSync && options.provider && options.provider !== "azure") {
|
|
4838
|
+
throw new Error("--cloud-sync currently supports --provider azure.");
|
|
4839
|
+
}
|
|
4840
|
+
};
|
|
4841
|
+
var appendOptionValue = (value, previous = []) => [
|
|
4842
|
+
...previous,
|
|
4843
|
+
value
|
|
4844
|
+
];
|
|
4643
4845
|
var writeDiagramImageHeaders = async (outputPath, headers) => {
|
|
4644
4846
|
await fs5.mkdir(path3.dirname(outputPath), { recursive: true });
|
|
4645
4847
|
const text = Object.entries(headers).sort(([left], [right]) => left.localeCompare(right)).map(([key, value]) => `${key}: ${value}`).join("\n");
|
|
@@ -4778,7 +4980,7 @@ var configureDiagramExportCommand = (command, deps) => addAuthOptions(command, d
|
|
|
4778
4980
|
const context = requireAuthUser(
|
|
4779
4981
|
await resolveAuthContext(options, actionCommand, deps)
|
|
4780
4982
|
);
|
|
4781
|
-
const core = await import("./dist-
|
|
4983
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
4782
4984
|
const projects = await core.getProjects(
|
|
4783
4985
|
context.baseUrl,
|
|
4784
4986
|
context.token,
|
|
@@ -4855,7 +5057,7 @@ var registerProjectsCommand = (program2, deps) => {
|
|
|
4855
5057
|
addCommon(addAuthOptions(projects.command("list").description("List projects"), deps.defaultBaseUrl)).action(async (options, command) => {
|
|
4856
5058
|
try {
|
|
4857
5059
|
const context = await resolveAuthContext(options, command, deps);
|
|
4858
|
-
const core = await import("./dist-
|
|
5060
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
4859
5061
|
const data = await listProjectsForContext(core, context);
|
|
4860
5062
|
const url = buildFrontendUrl({ baseUrl: frontendBase(context, options), target: "projects" });
|
|
4861
5063
|
await writeProjectListOutput({ data, options, frontendUrl: url });
|
|
@@ -4873,7 +5075,7 @@ var registerProjectsCommand = (program2, deps) => {
|
|
|
4873
5075
|
).action(async (id, options, command) => {
|
|
4874
5076
|
try {
|
|
4875
5077
|
const context = await resolveAuthContext(options, command, deps);
|
|
4876
|
-
const core = await import("./dist-
|
|
5078
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
4877
5079
|
const list = await listProjectsForContext(core, context);
|
|
4878
5080
|
const data = list.find((project) => project.id === id);
|
|
4879
5081
|
if (!data) {
|
|
@@ -4934,13 +5136,16 @@ var registerProjectsCommand = (program2, deps) => {
|
|
|
4934
5136
|
deps
|
|
4935
5137
|
);
|
|
4936
5138
|
configureGraphCommands(projects, deps);
|
|
4937
|
-
addCommon(addAuthOptions(projects.command("create").description("Create a
|
|
5139
|
+
addCommon(addAuthOptions(projects.command("create").description("Create a CloudEval project"), deps.defaultBaseUrl)).option("--template-url <url>", "Template URL").option("--template-file <path>", "Local JSON template file").option("--parameters-file <path>", "Local JSON parameters file").option("--parameters-url <url>", "Parameters file URL").option("--workspace-dir <path>", "Upload an Infrastructure as code folder").option("--workspace-entry <path>", "Workspace visualization entry file").option("--workspace-parameters <path>", "Workspace parameters file").option("--cloud-sync", "Create a Cloud sync project from Azure credentials", false).option("--azure-tenant-id <id>", "Azure tenant id for Cloud sync").option("--azure-client-id <id>", "Azure service principal client id for Cloud sync").option("--azure-client-secret <secret>", "Azure service principal client secret for Cloud sync").option("--azure-subscription-id <id>", "Azure subscription id for Cloud sync").option("--resource-group <name>", "Azure resource group scope for Cloud sync", appendOptionValue, []).option("--resource-groups <list>", "Comma-separated Azure resource group scopes for Cloud sync").option("--name <name>", "Project name").option("--description <text>", "Project description").option("--provider <provider>", "Cloud provider: azure, aws, gcp").action(async (options, command) => {
|
|
4938
5140
|
try {
|
|
5141
|
+
assertSingleProjectSource(options);
|
|
4939
5142
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
4940
|
-
const core = await import("./dist-
|
|
5143
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
4941
5144
|
const template = await fileBlob(options.templateFile);
|
|
4942
5145
|
const parameters = await fileBlob(options.parametersFile);
|
|
4943
|
-
const
|
|
5146
|
+
const workspace = options.workspaceDir ? await collectWorkspaceFiles(options.workspaceDir, options) : void 0;
|
|
5147
|
+
const cloudSync = resolveAzureCloudSyncInput(options);
|
|
5148
|
+
const inferredName = options.name || (options.workspaceDir ? path3.basename(path3.resolve(options.workspaceDir)) : void 0) || (cloudSync ? "Cloud sync" : void 0) || (options.templateFile ? path3.basename(options.templateFile, path3.extname(options.templateFile)) : void 0);
|
|
4944
5149
|
const result = await core.createQuickProject({
|
|
4945
5150
|
baseUrl: context.baseUrl,
|
|
4946
5151
|
authToken: context.token,
|
|
@@ -4951,9 +5156,12 @@ var registerProjectsCommand = (program2, deps) => {
|
|
|
4951
5156
|
parametersFile: parameters?.blob,
|
|
4952
5157
|
parametersFileName: parameters?.name,
|
|
4953
5158
|
parametersUrl: options.parametersUrl,
|
|
5159
|
+
workspaceFiles: workspace?.files,
|
|
5160
|
+
workspaceEntry: workspace?.entry,
|
|
5161
|
+
cloudSync,
|
|
4954
5162
|
name: inferredName,
|
|
4955
5163
|
description: options.description,
|
|
4956
|
-
provider: options.provider
|
|
5164
|
+
provider: options.provider ?? "azure"
|
|
4957
5165
|
});
|
|
4958
5166
|
const projectId = String(result.project.id);
|
|
4959
5167
|
const url = buildFrontendUrl({
|
|
@@ -4968,7 +5176,8 @@ var registerProjectsCommand = (program2, deps) => {
|
|
|
4968
5176
|
connection: result.connection,
|
|
4969
5177
|
syncStatus: result.syncStatus,
|
|
4970
5178
|
normalizedTemplateUrl: result.normalizedTemplateUrl,
|
|
4971
|
-
inferred: result.inferred
|
|
5179
|
+
inferred: result.inferred,
|
|
5180
|
+
iacPipeline: result.iacPipeline
|
|
4972
5181
|
},
|
|
4973
5182
|
format: options.format,
|
|
4974
5183
|
output: options.output,
|
|
@@ -5060,7 +5269,7 @@ var registerConnectionsCommand = (program2, deps) => {
|
|
|
5060
5269
|
addCommon2(addAuthOptions(connections.command("list").description("List connections"), deps.defaultBaseUrl)).action(async (options, command) => {
|
|
5061
5270
|
try {
|
|
5062
5271
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5063
|
-
const core = await import("./dist-
|
|
5272
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5064
5273
|
const data = await core.listConnections({
|
|
5065
5274
|
baseUrl: context.baseUrl,
|
|
5066
5275
|
authToken: context.token,
|
|
@@ -5085,7 +5294,7 @@ var registerConnectionsCommand = (program2, deps) => {
|
|
|
5085
5294
|
).action(async (id, options, command) => {
|
|
5086
5295
|
try {
|
|
5087
5296
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5088
|
-
const core = await import("./dist-
|
|
5297
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5089
5298
|
const data = await core.getConnection({
|
|
5090
5299
|
baseUrl: context.baseUrl,
|
|
5091
5300
|
authToken: context.token,
|
|
@@ -5423,7 +5632,7 @@ var checkoutReturnUrl = (context, options) => options.returnTo || billingUrl(con
|
|
|
5423
5632
|
var runTopUpCheckout = async (commandName, packId, options, command, deps) => {
|
|
5424
5633
|
try {
|
|
5425
5634
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5426
|
-
const core = await import("./dist-
|
|
5635
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5427
5636
|
const returnTo = checkoutReturnUrl(context, options);
|
|
5428
5637
|
const session = await core.createTopUpCheckoutSession({
|
|
5429
5638
|
baseUrl: context.baseUrl,
|
|
@@ -5463,7 +5672,7 @@ var registerBillingCommands = (program2, deps) => {
|
|
|
5463
5672
|
).action(async (options, command) => {
|
|
5464
5673
|
try {
|
|
5465
5674
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5466
|
-
const core = await import("./dist-
|
|
5675
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5467
5676
|
const range = rangeToDates("30d");
|
|
5468
5677
|
const [entitlement, usageSummary] = await Promise.all([
|
|
5469
5678
|
core.getBillingEntitlement({
|
|
@@ -5493,7 +5702,7 @@ var registerBillingCommands = (program2, deps) => {
|
|
|
5493
5702
|
addCommon3(addAuthOptions(billing.command("summary").description("Show billing summary"), deps.defaultBaseUrl)).action(async (options, command) => {
|
|
5494
5703
|
try {
|
|
5495
5704
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5496
|
-
const core = await import("./dist-
|
|
5705
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5497
5706
|
const range = rangeToDates("30d");
|
|
5498
5707
|
const [entitlement, subscriptionStatus, usageSummary] = await Promise.all([
|
|
5499
5708
|
core.getBillingEntitlement({ baseUrl: context.baseUrl, authToken: context.token }),
|
|
@@ -5529,7 +5738,7 @@ var registerBillingCommands = (program2, deps) => {
|
|
|
5529
5738
|
addCommon3(addAuthOptions(billing.command("plans").description("Show billing plans"), deps.defaultBaseUrl)).action(async (options, command) => {
|
|
5530
5739
|
try {
|
|
5531
5740
|
const context = await resolveAuthContext(options, command, deps);
|
|
5532
|
-
const core = await import("./dist-
|
|
5741
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5533
5742
|
const data = await core.getBillingConfig({ baseUrl: context.baseUrl, authToken: context.token });
|
|
5534
5743
|
const url = billingUrl(context, { ...options, tab: "plans" });
|
|
5535
5744
|
await write("billing plans", data, options, url);
|
|
@@ -5541,7 +5750,7 @@ var registerBillingCommands = (program2, deps) => {
|
|
|
5541
5750
|
addCommon3(addAuthOptions(billing.command("usage").description("Show billing usage summary"), deps.defaultBaseUrl)).option("--range <range>", "Usage range: 7d, 30d, 90d, all", "30d").option("--start-at <iso>", "Start timestamp").option("--end-at <iso>", "End timestamp").option("--granularity <value>", "Granularity: hour, day, month", "day").option("--action-type <type>", "Action type filter").option("--model <name>", "Model filter").option("--outcome <outcome>", "Outcome filter").option("--charge-status <status>", "Charge status filter").action(async (options, command) => {
|
|
5542
5751
|
try {
|
|
5543
5752
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5544
|
-
const core = await import("./dist-
|
|
5753
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5545
5754
|
const range = rangeToDates(options.range);
|
|
5546
5755
|
const data = await core.getBillingUsageSummary({
|
|
5547
5756
|
baseUrl: context.baseUrl,
|
|
@@ -5564,7 +5773,7 @@ var registerBillingCommands = (program2, deps) => {
|
|
|
5564
5773
|
addCommon3(addAuthOptions(billing.command("ledger").description("Show billing ledger"), deps.defaultBaseUrl)).option("--range <range>", "Usage range: 7d, 30d, 90d, all", "30d").option("--start-at <iso>", "Start timestamp").option("--end-at <iso>", "End timestamp").option("--action-type <type>", "Action type filter").option("--model <name>", "Model filter").option("--outcome <outcome>", "Outcome filter").option("--charge-status <status>", "Charge status filter").option("--limit <n>", "Page size", "25").option("--cursor <cursor>", "Pagination cursor").action(async (options, command) => {
|
|
5565
5774
|
try {
|
|
5566
5775
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5567
|
-
const core = await import("./dist-
|
|
5776
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5568
5777
|
const range = rangeToDates(options.range);
|
|
5569
5778
|
const data = await core.getBillingUsageLedger({
|
|
5570
5779
|
baseUrl: context.baseUrl,
|
|
@@ -5592,7 +5801,7 @@ var registerBillingCommands = (program2, deps) => {
|
|
|
5592
5801
|
addCommon3(addAuthOptions(billing.command(name).description(`Show billing ${name}`), deps.defaultBaseUrl)).option("--limit <n>", "Result limit", "25").action(async (options, command) => {
|
|
5593
5802
|
try {
|
|
5594
5803
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5595
|
-
const core = await import("./dist-
|
|
5804
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5596
5805
|
const data = await core[getter]({
|
|
5597
5806
|
baseUrl: context.baseUrl,
|
|
5598
5807
|
authToken: context.token,
|
|
@@ -5610,7 +5819,7 @@ var registerBillingCommands = (program2, deps) => {
|
|
|
5610
5819
|
addCommon3(addAuthOptions(topups, deps.defaultBaseUrl)).option("--limit <n>", "Result limit", "25").action(async (options, command) => {
|
|
5611
5820
|
try {
|
|
5612
5821
|
const context = requireAuthUser(await resolveAuthContext(options, command, deps));
|
|
5613
|
-
const core = await import("./dist-
|
|
5822
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
5614
5823
|
const data = await core.getTopUpPacks({
|
|
5615
5824
|
baseUrl: context.baseUrl,
|
|
5616
5825
|
authToken: context.token
|
|
@@ -8008,7 +8217,7 @@ var reportsFrontendUrl = (config, input) => buildFrontendUrl({
|
|
|
8008
8217
|
reportVerbosity: input.reportVerbosity
|
|
8009
8218
|
});
|
|
8010
8219
|
var resolveAuth = async (config, options = {}) => {
|
|
8011
|
-
const core = await import("./dist-
|
|
8220
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
8012
8221
|
core.assertSecureBaseUrl(config.baseUrl);
|
|
8013
8222
|
let token;
|
|
8014
8223
|
try {
|
|
@@ -8108,7 +8317,7 @@ var assertModelAvailable = async (config, token) => {
|
|
|
8108
8317
|
if (!config.model) {
|
|
8109
8318
|
return;
|
|
8110
8319
|
}
|
|
8111
|
-
const core = await import("./dist-
|
|
8320
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
8112
8321
|
try {
|
|
8113
8322
|
const response = await fetch(
|
|
8114
8323
|
`${core.normalizeApiBase(config.baseUrl)}/models`,
|
|
@@ -8365,7 +8574,7 @@ var buildToolHandlers = (serverOptions) => {
|
|
|
8365
8574
|
});
|
|
8366
8575
|
handlers.set("agent_profiles_list", async (args) => {
|
|
8367
8576
|
const config = await resolveInvocationConfig(serverOptions, args);
|
|
8368
|
-
const core = await import("./dist-
|
|
8577
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
8369
8578
|
const data = await listProfilesForDiscovery(core, config.baseUrl);
|
|
8370
8579
|
return withEnvelope({
|
|
8371
8580
|
command: "agents list",
|
|
@@ -8378,7 +8587,7 @@ var buildToolHandlers = (serverOptions) => {
|
|
|
8378
8587
|
throw new Error("profileId is required.");
|
|
8379
8588
|
}
|
|
8380
8589
|
const config = await resolveInvocationConfig(serverOptions, args);
|
|
8381
|
-
const core = await import("./dist-
|
|
8590
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
8382
8591
|
const data = await getProfileForDiscovery(core, config.baseUrl, profileId);
|
|
8383
8592
|
return withEnvelope({
|
|
8384
8593
|
command: "agents show",
|
|
@@ -9015,7 +9224,7 @@ var buildToolHandlers = (serverOptions) => {
|
|
|
9015
9224
|
});
|
|
9016
9225
|
handlers.set("auth_status", async (args) => {
|
|
9017
9226
|
const config = await resolveInvocationConfig(serverOptions, args);
|
|
9018
|
-
const core = await import("./dist-
|
|
9227
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
9019
9228
|
const data = await core.getAuthStatus(config.baseUrl, { validate: true });
|
|
9020
9229
|
return withEnvelope({
|
|
9021
9230
|
command: "auth status",
|
|
@@ -9024,7 +9233,7 @@ var buildToolHandlers = (serverOptions) => {
|
|
|
9024
9233
|
});
|
|
9025
9234
|
handlers.set("status", async (args) => {
|
|
9026
9235
|
const config = await resolveInvocationConfig(serverOptions, args);
|
|
9027
|
-
const core = await import("./dist-
|
|
9236
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
9028
9237
|
const auth = await core.getAuthStatus(config.baseUrl, { validate: true });
|
|
9029
9238
|
return withEnvelope({
|
|
9030
9239
|
command: "status",
|
|
@@ -9055,7 +9264,7 @@ var buildToolHandlers = (serverOptions) => {
|
|
|
9055
9264
|
}
|
|
9056
9265
|
];
|
|
9057
9266
|
try {
|
|
9058
|
-
const core = await import("./dist-
|
|
9267
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
9059
9268
|
core.assertSecureBaseUrl(config.baseUrl);
|
|
9060
9269
|
checks.push({
|
|
9061
9270
|
id: "base-url-secure",
|
|
@@ -9575,7 +9784,7 @@ var buildToolHandlers = (serverOptions) => {
|
|
|
9575
9784
|
} catch {
|
|
9576
9785
|
token = config.accessKey;
|
|
9577
9786
|
}
|
|
9578
|
-
const core = await import("./dist-
|
|
9787
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
9579
9788
|
const data = await core.getBillingConfig({
|
|
9580
9789
|
baseUrl: config.baseUrl,
|
|
9581
9790
|
authToken: token
|
|
@@ -10409,7 +10618,7 @@ var registerCapabilitiesCommand = (program2, deps) => {
|
|
|
10409
10618
|
warnIfAccessKeyFromCliOption(options, command);
|
|
10410
10619
|
let data = capabilities;
|
|
10411
10620
|
if (options.live) {
|
|
10412
|
-
const core = await import("./dist-
|
|
10621
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
10413
10622
|
const baseUrl = await deps.resolveBaseUrl(options, command);
|
|
10414
10623
|
const accessKey = options.accessKeyStdin ? await deps.readStdinValue() : options.accessKey;
|
|
10415
10624
|
const token = await core.getAuthToken({ accessKey, baseUrl });
|
|
@@ -10547,7 +10756,7 @@ var writeCredentialOutput = async (input) => {
|
|
|
10547
10756
|
};
|
|
10548
10757
|
var resolveCoreAuth = async (options, command, deps) => {
|
|
10549
10758
|
const context = await resolveAuthContext(options, command, deps);
|
|
10550
|
-
const core = await import("./dist-
|
|
10759
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
10551
10760
|
return { ...context, core };
|
|
10552
10761
|
};
|
|
10553
10762
|
var parseCapabilities = (value) => value?.split(",").map((item) => item.trim()).filter(Boolean);
|
|
@@ -10864,7 +11073,7 @@ var registerAgentsCommand = (program2, deps) => {
|
|
|
10864
11073
|
const agents = program2.command("agents").description("CloudEval Agent Profile utilities");
|
|
10865
11074
|
addAgentOutputOptions(agents.command("list").description("List Agent Profiles"), deps).action(async (options, command) => {
|
|
10866
11075
|
const baseUrl = await deps.resolveBaseUrl(options, command);
|
|
10867
|
-
const core = await import("./dist-
|
|
11076
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
10868
11077
|
core.assertSecureBaseUrl(baseUrl);
|
|
10869
11078
|
const data = await listProfilesForDiscovery2(core, baseUrl);
|
|
10870
11079
|
await writeProfiles({
|
|
@@ -10880,7 +11089,7 @@ var registerAgentsCommand = (program2, deps) => {
|
|
|
10880
11089
|
deps
|
|
10881
11090
|
).action(async (profileId, options, command) => {
|
|
10882
11091
|
const baseUrl = await deps.resolveBaseUrl(options, command);
|
|
10883
|
-
const core = await import("./dist-
|
|
11092
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
10884
11093
|
core.assertSecureBaseUrl(baseUrl);
|
|
10885
11094
|
const data = await getProfileForDiscovery2(core, baseUrl, profileId);
|
|
10886
11095
|
await writeProfiles({
|
|
@@ -10899,7 +11108,7 @@ var registerAgentsCommand = (program2, deps) => {
|
|
|
10899
11108
|
const cliProfile = getActiveConfigProfile(command);
|
|
10900
11109
|
const cliConfig = await loadCliConfig(cliProfile);
|
|
10901
11110
|
const auth = await resolveAuthContext(options, command, deps);
|
|
10902
|
-
const core = await import("./dist-
|
|
11111
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
10903
11112
|
const profileResponse = await core.getAgentProfile({
|
|
10904
11113
|
baseUrl: auth.baseUrl,
|
|
10905
11114
|
authToken: auth.token,
|
|
@@ -11397,7 +11606,7 @@ var registerDiagnosticsCommands = (program2, deps) => {
|
|
|
11397
11606
|
const baseUrl = await deps.resolveBaseUrl(options, command);
|
|
11398
11607
|
const profile = getActiveConfigProfile(command);
|
|
11399
11608
|
const config = await loadCliConfig(profile);
|
|
11400
|
-
const core = await import("./dist-
|
|
11609
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
11401
11610
|
const auth = await core.getAuthStatus(baseUrl, { validate: true });
|
|
11402
11611
|
if (options.format === "text" || !options.format) {
|
|
11403
11612
|
process.stdout.write(
|
|
@@ -11447,7 +11656,7 @@ var registerDiagnosticsCommands = (program2, deps) => {
|
|
|
11447
11656
|
detail: getCliConfigPath(profile)
|
|
11448
11657
|
});
|
|
11449
11658
|
try {
|
|
11450
|
-
const core = await import("./dist-
|
|
11659
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
11451
11660
|
core.assertSecureBaseUrl(baseUrl);
|
|
11452
11661
|
checks.push({
|
|
11453
11662
|
id: "base-url-secure",
|
|
@@ -11547,7 +11756,7 @@ var resolveToken2 = async (options, deps, baseUrl, command) => {
|
|
|
11547
11756
|
return options.accessKey;
|
|
11548
11757
|
}
|
|
11549
11758
|
try {
|
|
11550
|
-
const core = await import("./dist-
|
|
11759
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
11551
11760
|
return await core.getAuthToken({
|
|
11552
11761
|
baseUrl
|
|
11553
11762
|
});
|
|
@@ -11631,7 +11840,7 @@ var registerModelsCommand = (program2, deps) => {
|
|
|
11631
11840
|
let source = "fallback";
|
|
11632
11841
|
let modelList = fallbackModels;
|
|
11633
11842
|
try {
|
|
11634
|
-
const core = await import("./dist-
|
|
11843
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
11635
11844
|
const response = await fetch(`${core.normalizeApiBase(baseUrl)}/models`, {
|
|
11636
11845
|
headers: {
|
|
11637
11846
|
Accept: "application/json",
|
|
@@ -12803,7 +13012,7 @@ var uninstallCompletionScript = async (shell) => {
|
|
|
12803
13012
|
var runInteractiveLoginOnboarding = async (baseUrl, token) => {
|
|
12804
13013
|
const [{ render }, { Onboarding }] = await Promise.all([
|
|
12805
13014
|
import("ink"),
|
|
12806
|
-
import("./Onboarding-
|
|
13015
|
+
import("./Onboarding-QUB2SCWP.js")
|
|
12807
13016
|
]);
|
|
12808
13017
|
await new Promise((resolve) => {
|
|
12809
13018
|
let app;
|
|
@@ -13037,7 +13246,7 @@ var resolveBaseUrl = async (options, command) => {
|
|
|
13037
13246
|
});
|
|
13038
13247
|
}
|
|
13039
13248
|
try {
|
|
13040
|
-
const { getAuthStatus } = await import("./dist-
|
|
13249
|
+
const { getAuthStatus } = await import("./dist-AS6Z6RQQ.js");
|
|
13041
13250
|
const status = await getAuthStatus();
|
|
13042
13251
|
const storedBaseUrl = status.baseUrl;
|
|
13043
13252
|
if (storedBaseUrl && shouldUseStoredBaseUrl(storedBaseUrl)) {
|
|
@@ -13108,7 +13317,7 @@ program.command("login").description("Authenticate with Cloudeval").option(
|
|
|
13108
13317
|
checkUserStatus,
|
|
13109
13318
|
ensurePlaygroundProject,
|
|
13110
13319
|
login
|
|
13111
|
-
} = await import("./dist-
|
|
13320
|
+
} = await import("./dist-AS6Z6RQQ.js");
|
|
13112
13321
|
assertSecureBaseUrl(options.baseUrl);
|
|
13113
13322
|
const headlessEnvironment = isHeadlessEnvironment();
|
|
13114
13323
|
const headlessLogin = options.headless || headlessEnvironment;
|
|
@@ -13172,7 +13381,7 @@ program.command("logout").description("Log out and clear stored authentication s
|
|
|
13172
13381
|
DEFAULT_BASE_URL
|
|
13173
13382
|
).option("--all-devices", "Revoke sessions on all devices", false).action(async (options) => {
|
|
13174
13383
|
try {
|
|
13175
|
-
const { assertSecureBaseUrl, logout } = await import("./dist-
|
|
13384
|
+
const { assertSecureBaseUrl, logout } = await import("./dist-AS6Z6RQQ.js");
|
|
13176
13385
|
assertSecureBaseUrl(options.baseUrl);
|
|
13177
13386
|
const result = await logout({
|
|
13178
13387
|
baseUrl: options.baseUrl,
|
|
@@ -13196,7 +13405,7 @@ authCommand.command("status").description("Show current authentication status").
|
|
|
13196
13405
|
DEFAULT_BASE_URL
|
|
13197
13406
|
).option("--format <format>", "Output format: text, json, ndjson, markdown", "text").option("--show-sensitive-ids", "Show full account/session identifiers in command output", false).option("-v, --verbose", "Enable verbose logging and show full non-token identifiers", false).action(async (options, command) => {
|
|
13198
13407
|
try {
|
|
13199
|
-
const { assertSecureBaseUrl, getAuthStatus } = await import("./dist-
|
|
13408
|
+
const { assertSecureBaseUrl, getAuthStatus } = await import("./dist-AS6Z6RQQ.js");
|
|
13200
13409
|
const effectiveBaseUrl = await resolveBaseUrl(options, command);
|
|
13201
13410
|
assertSecureBaseUrl(effectiveBaseUrl);
|
|
13202
13411
|
const status = await getAuthStatus(effectiveBaseUrl, { validate: true });
|
|
@@ -13379,10 +13588,10 @@ program.command("tui").description("Open the CloudEval Terminal UI").option(
|
|
|
13379
13588
|
"Access key for automation",
|
|
13380
13589
|
process.env.CLOUDEVAL_ACCESS_KEY
|
|
13381
13590
|
).option("--access-key-stdin", "Read access key from stdin (recommended for automation)", false).option("--model <name>", "Model name").option("--debug", "Log raw chunks", false).option("--health-check", "Enable health check (disabled by default)").option("--no-banner", "Disable ASCII banner").option("--animate", "Enable TUI animations (default)").option("--no-anim", "Disable TUI animations").option("-v, --verbose", "Enable verbose logging", false).action(async (options, command) => {
|
|
13382
|
-
const { assertSecureBaseUrl } = await import("./dist-
|
|
13591
|
+
const { assertSecureBaseUrl } = await import("./dist-AS6Z6RQQ.js");
|
|
13383
13592
|
const [{ render }, { App }] = await Promise.all([
|
|
13384
13593
|
import("ink"),
|
|
13385
|
-
import("./App-
|
|
13594
|
+
import("./App-G6ACKT3M.js")
|
|
13386
13595
|
]);
|
|
13387
13596
|
const baseUrl = await resolveBaseUrl(options, command);
|
|
13388
13597
|
assertSecureBaseUrl(baseUrl);
|
|
@@ -13431,10 +13640,10 @@ program.command("chat").description("Start an interactive chat session").option(
|
|
|
13431
13640
|
"Access key for automation",
|
|
13432
13641
|
process.env.CLOUDEVAL_ACCESS_KEY
|
|
13433
13642
|
).option("--access-key-stdin", "Read access key from stdin (recommended for automation)", false).option("--conversation <id>", "Conversation/thread id to resume").option("--continue", "Resume the most recent local chat session", false).option("--resume <id-or-title>", "Resume a local chat session by thread id or title").option("--model <name>", "Model name").option("--mode <mode>", "Initial chat mode: ask, agent").option("--debug", "Log raw chunks", false).option("--health-check", "Enable health check (disabled by default)").option("--no-banner", "Disable ASCII banner").option("--animate", "Enable TUI animations (default)").option("--no-anim", "Disable TUI animations").option("-v, --verbose", "Enable verbose logging", false).action(async (options, command) => {
|
|
13434
|
-
const { assertSecureBaseUrl } = await import("./dist-
|
|
13643
|
+
const { assertSecureBaseUrl } = await import("./dist-AS6Z6RQQ.js");
|
|
13435
13644
|
const [{ render }, { App }] = await Promise.all([
|
|
13436
13645
|
import("ink"),
|
|
13437
|
-
import("./App-
|
|
13646
|
+
import("./App-G6ACKT3M.js")
|
|
13438
13647
|
]);
|
|
13439
13648
|
const baseUrl = await resolveBaseUrl(options, command);
|
|
13440
13649
|
assertSecureBaseUrl(baseUrl);
|
|
@@ -13503,7 +13712,7 @@ program.command("ask").alias("agent").description("Ask a single question or run
|
|
|
13503
13712
|
const question = Array.isArray(questionParts) ? questionParts.join(" ") : String(questionParts);
|
|
13504
13713
|
const commandName = command.parent?.args?.[0] === "agent" ? "agent" : "ask";
|
|
13505
13714
|
const selectedMode = commandName === "agent" ? "agent" : "ask";
|
|
13506
|
-
const { assertSecureBaseUrl } = await import("./dist-
|
|
13715
|
+
const { assertSecureBaseUrl } = await import("./dist-AS6Z6RQQ.js");
|
|
13507
13716
|
const baseUrl = await resolveBaseUrl(options, command);
|
|
13508
13717
|
assertSecureBaseUrl(baseUrl);
|
|
13509
13718
|
const selectedProfile = getActiveConfigProfile(command);
|
|
@@ -13544,7 +13753,7 @@ program.command("ask").alias("agent").description("Ask a single question or run
|
|
|
13544
13753
|
const fs13 = await import("fs");
|
|
13545
13754
|
const fsPromises = await import("fs/promises");
|
|
13546
13755
|
const { randomUUID: randomUUID5 } = await import("crypto");
|
|
13547
|
-
const core = await import("./dist-
|
|
13756
|
+
const core = await import("./dist-AS6Z6RQQ.js");
|
|
13548
13757
|
const {
|
|
13549
13758
|
streamChat,
|
|
13550
13759
|
reduceChunk,
|
|
@@ -13602,7 +13811,7 @@ program.command("ask").alias("agent").description("Ask a single question or run
|
|
|
13602
13811
|
console.error("Authentication required. Starting login process...\n");
|
|
13603
13812
|
}
|
|
13604
13813
|
try {
|
|
13605
|
-
const { login } = await import("./dist-
|
|
13814
|
+
const { login } = await import("./dist-AS6Z6RQQ.js");
|
|
13606
13815
|
verboseLog("Calling interactive login", { baseUrl });
|
|
13607
13816
|
token = await login(baseUrl, {
|
|
13608
13817
|
headless: isHeadlessEnvironment()
|
|
@@ -14191,7 +14400,7 @@ Error: ${errorMsg}
|
|
|
14191
14400
|
program.command("banner").description("Preview the startup banner and terminal capabilities").action(async () => {
|
|
14192
14401
|
const { render } = await import("ink");
|
|
14193
14402
|
const BannerPreview = React.lazy(async () => ({
|
|
14194
|
-
default: (await import("./Banner-
|
|
14403
|
+
default: (await import("./Banner-UIKOHSAV.js")).Banner
|
|
14195
14404
|
}));
|
|
14196
14405
|
render(
|
|
14197
14406
|
/* @__PURE__ */ jsx(React.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(BannerPreview, { disable: false }) })
|
package/package.json
CHANGED
package/sbom.spdx.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{
|
|
15
15
|
"SPDXID": "SPDXRef-Package-CloudEval-CLI",
|
|
16
16
|
"name": "CloudEval CLI",
|
|
17
|
-
"versionInfo": "0.
|
|
17
|
+
"versionInfo": "0.23.0",
|
|
18
18
|
"downloadLocation": "https://github.com/ganakailabs/cloudeval-cli",
|
|
19
19
|
"filesAnalyzed": false,
|
|
20
20
|
"licenseConcluded": "LicenseRef-CloudEval-CLI",
|