@camunda8/cli 4.7.0-alpha.28 → 4.7.0-alpha.29
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.
|
@@ -3226,7 +3226,10 @@ export async function deleteVersion(cacheDir, versionSpec) {
|
|
|
3226
3226
|
|
|
3227
3227
|
const config = { cacheDir, version: resolvedVersion };
|
|
3228
3228
|
|
|
3229
|
-
|
|
3229
|
+
// Guard on the install dir, not on the binary: the dir can survive
|
|
3230
|
+
// without its launcher (partial/corrupt install), and delete should
|
|
3231
|
+
// still remove what is left rather than report the version unremovable.
|
|
3232
|
+
if (!existsSync(join(cacheDir, `c8run-${resolvedVersion}`))) {
|
|
3230
3233
|
logger.warn(`Version ${versionSpec} is not installed locally.`);
|
|
3231
3234
|
return;
|
|
3232
3235
|
}
|
|
@@ -12,10 +12,10 @@ development.
|
|
|
12
12
|
`--yes`.
|
|
13
13
|
- `c8ctl setup --yes` — set up the defaults without prompting (Rocket Launch
|
|
14
14
|
blueprint).
|
|
15
|
-
- `c8ctl setup --remove
|
|
16
|
-
|
|
17
|
-
and
|
|
18
|
-
|
|
15
|
+
- `c8ctl setup --remove` — preview and remove setup-managed MCP entries,
|
|
16
|
+
Camunda skills, a c8ctl-managed Desktop Modeler installation, blueprint
|
|
17
|
+
files, and the local cluster: the cluster is stopped, and its runtime
|
|
18
|
+
data and downloaded Camunda 8 Run binaries are deleted.
|
|
19
19
|
|
|
20
20
|
## Architecture
|
|
21
21
|
|
|
@@ -29,12 +29,13 @@ only when a step fails.
|
|
|
29
29
|
Removal orchestrates the same owners: the unified preview is built from
|
|
30
30
|
shared inspection helpers and a `modeler uninstall --dry-run` probe, and after
|
|
31
31
|
one confirmation the actual teardown runs as child commands —
|
|
32
|
-
`c8ctl
|
|
32
|
+
`c8ctl cluster stop --purge` followed by `c8ctl cluster purge`/`delete` per
|
|
33
|
+
installed version, `c8ctl mcp uninstall` per harness,
|
|
33
34
|
`c8ctl skills uninstall --harness <harness> --yes`, and `c8ctl modeler uninstall`.
|
|
34
35
|
|
|
35
36
|
## Flags
|
|
36
37
|
|
|
37
|
-
`--modeler`, `--no-modeler`, `--docs-mcp`, `--remove`,
|
|
38
|
+
`--modeler`, `--no-modeler`, `--docs-mcp`, `--remove`, plus
|
|
38
39
|
the global `--yes`, `--json`, `--dry-run`, `--quiet`, and `--verbose` flags.
|
|
39
40
|
|
|
40
41
|
**Exit codes:** `0` when every selected step succeeded or nothing was
|
|
@@ -2025,7 +2025,7 @@ var require_semver2 = __commonJS({
|
|
|
2025
2025
|
// default-plugins/setup/c8ctl-plugin.ts
|
|
2026
2026
|
import { spawn as spawn2 } from "node:child_process";
|
|
2027
2027
|
import {
|
|
2028
|
-
existsSync as
|
|
2028
|
+
existsSync as existsSync6,
|
|
2029
2029
|
mkdtempSync,
|
|
2030
2030
|
readFileSync as readFileSync6,
|
|
2031
2031
|
realpathSync as realpathSync3,
|
|
@@ -2033,7 +2033,7 @@ import {
|
|
|
2033
2033
|
writeFileSync as writeFileSync3
|
|
2034
2034
|
} from "node:fs";
|
|
2035
2035
|
import { tmpdir } from "node:os";
|
|
2036
|
-
import { join as
|
|
2036
|
+
import { join as join7, resolve as resolve4 } from "node:path";
|
|
2037
2037
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
2038
2038
|
|
|
2039
2039
|
// node_modules/@camunda8/orchestration-cluster-api/dist/index.js
|
|
@@ -4910,6 +4910,34 @@ async function scaffoldSetupBlueprint({
|
|
|
4910
4910
|
}
|
|
4911
4911
|
|
|
4912
4912
|
// default-plugins/setup/detectors.ts
|
|
4913
|
+
import { existsSync as existsSync4, readdirSync as readdirSync2 } from "node:fs";
|
|
4914
|
+
import { homedir as homedir4 } from "node:os";
|
|
4915
|
+
import { join as join5 } from "node:path";
|
|
4916
|
+
function c8runCacheDir({
|
|
4917
|
+
env = process.env,
|
|
4918
|
+
platform: platform2 = process.platform,
|
|
4919
|
+
home = homedir4()
|
|
4920
|
+
} = {}) {
|
|
4921
|
+
if (env.C8RUN_CACHE_DIR) return env.C8RUN_CACHE_DIR;
|
|
4922
|
+
switch (platform2) {
|
|
4923
|
+
case "darwin":
|
|
4924
|
+
return join5(home, "Library", "Caches", "c8run");
|
|
4925
|
+
case "win32":
|
|
4926
|
+
return join5(
|
|
4927
|
+
env.LOCALAPPDATA || join5(home, "AppData", "Local"),
|
|
4928
|
+
"c8run",
|
|
4929
|
+
"cache"
|
|
4930
|
+
);
|
|
4931
|
+
default:
|
|
4932
|
+
return join5(env.XDG_CACHE_HOME || join5(home, ".cache"), "c8run");
|
|
4933
|
+
}
|
|
4934
|
+
}
|
|
4935
|
+
function camunda8RunInstallDirs({
|
|
4936
|
+
cacheDir = c8runCacheDir()
|
|
4937
|
+
} = {}) {
|
|
4938
|
+
if (!existsSync4(cacheDir)) return [];
|
|
4939
|
+
return readdirSync2(cacheDir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.startsWith("c8run-")).map((entry) => entry.name.slice("c8run-".length)).sort((a, b) => a.localeCompare(b, void 0, { numeric: true }));
|
|
4940
|
+
}
|
|
4913
4941
|
var LOCAL_CLUSTER_HEALTH_URL = "http://localhost:9600/actuator/health";
|
|
4914
4942
|
var DEFAULT_HEALTH_TIMEOUT_MS = 3e3;
|
|
4915
4943
|
function causeCode(error) {
|
|
@@ -5250,8 +5278,8 @@ function setupPlanPayload(selected, { blueprint } = {}) {
|
|
|
5250
5278
|
|
|
5251
5279
|
// default-plugins/setup/prerequisites.ts
|
|
5252
5280
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
5253
|
-
import { existsSync as
|
|
5254
|
-
import { join as
|
|
5281
|
+
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
5282
|
+
import { join as join6 } from "node:path";
|
|
5255
5283
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
5256
5284
|
var MANUAL_SETUP_LINKS = [
|
|
5257
5285
|
{
|
|
@@ -5271,9 +5299,9 @@ function readRequiredNodeRange2() {
|
|
|
5271
5299
|
try {
|
|
5272
5300
|
const dir = fileURLToPath3(new URL(".", import.meta.url));
|
|
5273
5301
|
const packageJson = [
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
].find((candidate) =>
|
|
5302
|
+
join6(dir, "..", "..", "package.json"),
|
|
5303
|
+
join6(dir, "..", "..", "..", "package.json")
|
|
5304
|
+
].find((candidate) => existsSync5(candidate));
|
|
5277
5305
|
if (!packageJson) return void 0;
|
|
5278
5306
|
const pkg = JSON.parse(readFileSync5(packageJson, "utf-8"));
|
|
5279
5307
|
const engines = pkg && typeof pkg === "object" && "engines" in pkg ? pkg.engines : void 0;
|
|
@@ -5438,7 +5466,8 @@ var SETUP_MCP_HARNESSES = [
|
|
|
5438
5466
|
];
|
|
5439
5467
|
async function inspectSetupRemovalInventory({
|
|
5440
5468
|
cwd = process.cwd(),
|
|
5441
|
-
detectModeler
|
|
5469
|
+
detectModeler,
|
|
5470
|
+
detectClusterRunning: detectClusterRunning2
|
|
5442
5471
|
} = {}) {
|
|
5443
5472
|
const mcpHarnesses = process.platform === "darwin" || process.platform === "win32" ? [...SETUP_MCP_HARNESSES, "claude-desktop"] : [...SETUP_MCP_HARNESSES];
|
|
5444
5473
|
const mcpPlanningFailures = [];
|
|
@@ -5501,6 +5530,31 @@ async function inspectSetupRemovalInventory({
|
|
|
5501
5530
|
};
|
|
5502
5531
|
}
|
|
5503
5532
|
}
|
|
5533
|
+
let cluster;
|
|
5534
|
+
let clusterInspectionFailure;
|
|
5535
|
+
try {
|
|
5536
|
+
const versions = camunda8RunInstallDirs();
|
|
5537
|
+
let probe;
|
|
5538
|
+
if (versions.length === 0 && detectClusterRunning2) {
|
|
5539
|
+
try {
|
|
5540
|
+
probe = await detectClusterRunning2();
|
|
5541
|
+
} catch (error) {
|
|
5542
|
+
clusterInspectionFailure = {
|
|
5543
|
+
message: error instanceof Error ? error.message : String(error)
|
|
5544
|
+
};
|
|
5545
|
+
}
|
|
5546
|
+
}
|
|
5547
|
+
if (versions.length > 0 || probe?.running) {
|
|
5548
|
+
cluster = {
|
|
5549
|
+
versions,
|
|
5550
|
+
...probe?.running && probe.version ? { runningVersion: probe.version } : {}
|
|
5551
|
+
};
|
|
5552
|
+
}
|
|
5553
|
+
} catch (error) {
|
|
5554
|
+
clusterInspectionFailure = {
|
|
5555
|
+
message: error instanceof Error ? error.message : String(error)
|
|
5556
|
+
};
|
|
5557
|
+
}
|
|
5504
5558
|
return {
|
|
5505
5559
|
mcp,
|
|
5506
5560
|
mcpPlanningFailures,
|
|
@@ -5509,7 +5563,9 @@ async function inspectSetupRemovalInventory({
|
|
|
5509
5563
|
blueprints,
|
|
5510
5564
|
blueprintPlanningFailures,
|
|
5511
5565
|
modeler,
|
|
5512
|
-
modelerInspectionFailure
|
|
5566
|
+
modelerInspectionFailure,
|
|
5567
|
+
cluster,
|
|
5568
|
+
clusterInspectionFailure
|
|
5513
5569
|
};
|
|
5514
5570
|
}
|
|
5515
5571
|
|
|
@@ -5554,7 +5610,7 @@ var CLI_ENTRY = (() => {
|
|
|
5554
5610
|
resolve4(dir, "..", "..", "index.js"),
|
|
5555
5611
|
resolve4(dir, "..", "..", "src", "index.ts")
|
|
5556
5612
|
];
|
|
5557
|
-
return candidates.find((candidate) =>
|
|
5613
|
+
return candidates.find((candidate) => existsSync6(candidate)) ?? candidates[0];
|
|
5558
5614
|
})();
|
|
5559
5615
|
function spawnC8ctl(ctx, argv, {
|
|
5560
5616
|
skipStdoutLine,
|
|
@@ -5618,6 +5674,12 @@ function spawnClusterStop(ctx) {
|
|
|
5618
5674
|
stderrPassthrough: true
|
|
5619
5675
|
});
|
|
5620
5676
|
}
|
|
5677
|
+
function spawnClusterStopPurge(ctx) {
|
|
5678
|
+
return spawnC8ctl(ctx, ["cluster", "stop", "--purge"], {
|
|
5679
|
+
promoteStdoutLine: () => true,
|
|
5680
|
+
stderrPassthrough: true
|
|
5681
|
+
});
|
|
5682
|
+
}
|
|
5621
5683
|
function captureC8ctlJson(argv) {
|
|
5622
5684
|
const label = `c8ctl ${argv.join(" ")}`;
|
|
5623
5685
|
return new Promise((resolvePromise, rejectPromise) => {
|
|
@@ -5691,6 +5753,35 @@ async function detectModelerRemoval() {
|
|
|
5691
5753
|
}
|
|
5692
5754
|
var CLUSTER_HEALTH_TIMEOUT_MS = 12e4;
|
|
5693
5755
|
var CLUSTER_HEALTH_POLL_MS = 2e3;
|
|
5756
|
+
function parseClusterStatus(payload) {
|
|
5757
|
+
if (!isRecord(payload) || typeof payload.status !== "string") {
|
|
5758
|
+
return void 0;
|
|
5759
|
+
}
|
|
5760
|
+
return {
|
|
5761
|
+
running: payload.status !== "stopped",
|
|
5762
|
+
version: typeof payload.version === "string" && payload.version.length > 0 ? payload.version : void 0
|
|
5763
|
+
};
|
|
5764
|
+
}
|
|
5765
|
+
async function probeRunningCluster() {
|
|
5766
|
+
try {
|
|
5767
|
+
return parseClusterStatus(
|
|
5768
|
+
await captureC8ctlJson(["cluster", "status", "--json"])
|
|
5769
|
+
);
|
|
5770
|
+
} catch {
|
|
5771
|
+
return void 0;
|
|
5772
|
+
}
|
|
5773
|
+
}
|
|
5774
|
+
async function detectClusterRunning() {
|
|
5775
|
+
const probe = parseClusterStatus(
|
|
5776
|
+
await captureC8ctlJson(["cluster", "status", "--json"])
|
|
5777
|
+
);
|
|
5778
|
+
if (!probe) {
|
|
5779
|
+
throw new Error(
|
|
5780
|
+
'cluster status --json returned an invalid response: expected a string "status" field.'
|
|
5781
|
+
);
|
|
5782
|
+
}
|
|
5783
|
+
return probe;
|
|
5784
|
+
}
|
|
5694
5785
|
async function runClusterStart(ctx, run) {
|
|
5695
5786
|
await spawnClusterStart(ctx);
|
|
5696
5787
|
const deadline = Date.now() + CLUSTER_HEALTH_TIMEOUT_MS;
|
|
@@ -5737,7 +5828,7 @@ async function runBlueprintDeploy(ctx, run) {
|
|
|
5737
5828
|
if (!directory) {
|
|
5738
5829
|
throw new Error("The blueprint project was not created.");
|
|
5739
5830
|
}
|
|
5740
|
-
const deployDir =
|
|
5831
|
+
const deployDir = join7(directory, blueprint.deployPath ?? ".");
|
|
5741
5832
|
const health = await checkLocalClusterHealth();
|
|
5742
5833
|
if (!health.healthy) {
|
|
5743
5834
|
throw new Error(
|
|
@@ -5750,7 +5841,7 @@ async function runBlueprintDeploy(ctx, run) {
|
|
|
5750
5841
|
].join("\n")
|
|
5751
5842
|
);
|
|
5752
5843
|
}
|
|
5753
|
-
const deployDataDir = mkdtempSync(
|
|
5844
|
+
const deployDataDir = mkdtempSync(join7(tmpdir(), "c8ctl-setup-deploy-"));
|
|
5754
5845
|
stageLocalProfile(deployDataDir);
|
|
5755
5846
|
try {
|
|
5756
5847
|
await spawnC8ctl(
|
|
@@ -5773,7 +5864,7 @@ async function runBlueprintDeploy(ctx, run) {
|
|
|
5773
5864
|
} finally {
|
|
5774
5865
|
rmSync3(deployDataDir, { recursive: true, force: true });
|
|
5775
5866
|
}
|
|
5776
|
-
const processFile =
|
|
5867
|
+
const processFile = join7(directory, blueprint.processFile);
|
|
5777
5868
|
const processId = extractProcessId(readFileSync6(processFile, "utf-8"));
|
|
5778
5869
|
if (!processId) {
|
|
5779
5870
|
throw new Error(`Could not find a process id in ${blueprint.processFile}.`);
|
|
@@ -5790,14 +5881,14 @@ async function runBlueprintDeploy(ctx, run) {
|
|
|
5790
5881
|
run.processInstanceKey = created.processInstanceKey;
|
|
5791
5882
|
}
|
|
5792
5883
|
function stageLocalProfile(deployDataDir) {
|
|
5793
|
-
const profilesPath =
|
|
5794
|
-
if (!
|
|
5884
|
+
const profilesPath = join7(c8ctl2.getUserDataDir(), "profiles.json");
|
|
5885
|
+
if (!existsSync6(profilesPath)) return;
|
|
5795
5886
|
const parsed = JSON.parse(readFileSync6(profilesPath, "utf-8"));
|
|
5796
5887
|
const profiles = isRecord(parsed) && Array.isArray(parsed.profiles) ? parsed.profiles : [];
|
|
5797
5888
|
const local = profiles.filter(isRecord).find((profile) => profile.name === DEFAULT_PROFILE);
|
|
5798
5889
|
if (!local) return;
|
|
5799
5890
|
writeFileSync3(
|
|
5800
|
-
|
|
5891
|
+
join7(deployDataDir, "profiles.json"),
|
|
5801
5892
|
JSON.stringify({
|
|
5802
5893
|
profiles: [{ ...local, defaultTenantId: LOCAL_TENANT_ID }]
|
|
5803
5894
|
}),
|
|
@@ -6003,7 +6094,7 @@ function modelerRemovalLine(message) {
|
|
|
6003
6094
|
if (match) return `Remove ${match[1]}`;
|
|
6004
6095
|
return `Remove Camunda Desktop Modeler with \`c8ctl modeler uninstall\` (${message})`;
|
|
6005
6096
|
}
|
|
6006
|
-
function setupRemovalPreview(inventory
|
|
6097
|
+
function setupRemovalPreview(inventory) {
|
|
6007
6098
|
const items = [];
|
|
6008
6099
|
const warnings = [];
|
|
6009
6100
|
const lines = ["Setup removal preview:"];
|
|
@@ -6040,6 +6131,11 @@ function setupRemovalPreview(inventory, stopCluster) {
|
|
|
6040
6131
|
warnings.push(warning);
|
|
6041
6132
|
lines.push(` Warning: ${warning}`);
|
|
6042
6133
|
}
|
|
6134
|
+
if (inventory.clusterInspectionFailure) {
|
|
6135
|
+
const warning = `Could not inspect the local Camunda 8 Run installation: ${inventory.clusterInspectionFailure.message}. The cluster was left untouched.`;
|
|
6136
|
+
warnings.push(warning);
|
|
6137
|
+
lines.push(` Warning: ${warning}`);
|
|
6138
|
+
}
|
|
6043
6139
|
for (const failure of inventory.blueprintPlanningFailures) {
|
|
6044
6140
|
const warning = `Could not inspect setup blueprint marker in ${failure.directory}: ${failure.message}. That project was left untouched.`;
|
|
6045
6141
|
warnings.push(warning);
|
|
@@ -6078,11 +6174,19 @@ function setupRemovalPreview(inventory, stopCluster) {
|
|
|
6078
6174
|
);
|
|
6079
6175
|
for (const file of files) lines.push(` ${file}`);
|
|
6080
6176
|
}
|
|
6081
|
-
if (
|
|
6082
|
-
items.push({
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6177
|
+
if (inventory.cluster) {
|
|
6178
|
+
items.push({
|
|
6179
|
+
type: "local-cluster",
|
|
6180
|
+
action: "remove",
|
|
6181
|
+
versions: [...inventory.cluster.versions]
|
|
6182
|
+
});
|
|
6183
|
+
if (inventory.cluster.versions.length > 0) {
|
|
6184
|
+
lines.push(
|
|
6185
|
+
` Stop the local cluster and remove Camunda 8 Run ${inventory.cluster.versions.join(", ")} (runtime data and downloaded binaries will be deleted)`
|
|
6186
|
+
);
|
|
6187
|
+
} else {
|
|
6188
|
+
lines.push(" Stop the local cluster");
|
|
6189
|
+
}
|
|
6086
6190
|
}
|
|
6087
6191
|
if (items.length === 0)
|
|
6088
6192
|
lines.push(" No setup-managed components were found.");
|
|
@@ -6105,9 +6209,9 @@ function removalFailure(ctx, action, error) {
|
|
|
6105
6209
|
const message = error instanceof Error ? error.message : String(error);
|
|
6106
6210
|
ctx.logger.error(`Could not ${action}: ${message}`);
|
|
6107
6211
|
}
|
|
6108
|
-
async function applySetupRemoval(ctx, inventory
|
|
6212
|
+
async function applySetupRemoval(ctx, inventory) {
|
|
6109
6213
|
const { logger } = ctx;
|
|
6110
|
-
let failures = inventory.mcpPlanningFailures.length + inventory.skillDiscoveryFailures.length + inventory.blueprintPlanningFailures.length + (inventory.modelerInspectionFailure ? 1 : 0);
|
|
6214
|
+
let failures = inventory.mcpPlanningFailures.length + inventory.skillDiscoveryFailures.length + inventory.blueprintPlanningFailures.length + (inventory.modelerInspectionFailure ? 1 : 0) + (inventory.clusterInspectionFailure ? 1 : 0);
|
|
6111
6215
|
for (const failure of inventory.mcpPlanningFailures) {
|
|
6112
6216
|
logger.error(
|
|
6113
6217
|
`Could not inspect MCP configuration for ${failure.harness}: ${failure.message}. That configuration was left untouched.`
|
|
@@ -6128,16 +6232,67 @@ async function applySetupRemoval(ctx, inventory, stopCluster) {
|
|
|
6128
6232
|
`Could not inspect the Camunda Desktop Modeler installation: ${inventory.modelerInspectionFailure.message}. Modeler was left untouched.`
|
|
6129
6233
|
);
|
|
6130
6234
|
}
|
|
6131
|
-
if (
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6235
|
+
if (inventory.clusterInspectionFailure) {
|
|
6236
|
+
logger.error(
|
|
6237
|
+
`Could not inspect the local Camunda 8 Run installation: ${inventory.clusterInspectionFailure.message}. The cluster was left untouched.`
|
|
6238
|
+
);
|
|
6239
|
+
}
|
|
6240
|
+
if (inventory.cluster) {
|
|
6241
|
+
const probe = await probeRunningCluster();
|
|
6242
|
+
let purgedByStop;
|
|
6243
|
+
if (probe === void 0) {
|
|
6139
6244
|
failures += 1;
|
|
6140
|
-
|
|
6245
|
+
logger.error(
|
|
6246
|
+
"Could not determine whether the local cluster is running (the cluster status probe failed); it was not stopped. Stop it yourself with: c8ctl cluster stop"
|
|
6247
|
+
);
|
|
6248
|
+
} else if (probe.running) {
|
|
6249
|
+
if (probe.version && inventory.cluster.versions.includes(probe.version)) {
|
|
6250
|
+
try {
|
|
6251
|
+
await spawnClusterStopPurge(ctx);
|
|
6252
|
+
purgedByStop = probe.version;
|
|
6253
|
+
} catch (error) {
|
|
6254
|
+
failures += 1;
|
|
6255
|
+
removalFailure(ctx, "stop the local cluster", error);
|
|
6256
|
+
}
|
|
6257
|
+
} else if (probe.version && probe.version !== inventory.cluster.runningVersion) {
|
|
6258
|
+
failures += 1;
|
|
6259
|
+
logger.error(
|
|
6260
|
+
`Camunda 8 Run ${probe.version} is running but was not in the removal preview; leaving it running and keeping its data. Stop it yourself with: c8ctl cluster stop`
|
|
6261
|
+
);
|
|
6262
|
+
} else {
|
|
6263
|
+
try {
|
|
6264
|
+
await spawnClusterStop(ctx);
|
|
6265
|
+
} catch (error) {
|
|
6266
|
+
failures += 1;
|
|
6267
|
+
removalFailure(ctx, "stop the local cluster", error);
|
|
6268
|
+
}
|
|
6269
|
+
}
|
|
6270
|
+
}
|
|
6271
|
+
for (const version of inventory.cluster.versions) {
|
|
6272
|
+
if (version !== purgedByStop) {
|
|
6273
|
+
try {
|
|
6274
|
+
await spawnC8ctl(ctx, ["cluster", "purge", version], {
|
|
6275
|
+
promoteStdoutLine: () => true,
|
|
6276
|
+
stderrPassthrough: true
|
|
6277
|
+
});
|
|
6278
|
+
} catch (error) {
|
|
6279
|
+
failures += 1;
|
|
6280
|
+
removalFailure(
|
|
6281
|
+
ctx,
|
|
6282
|
+
`delete the runtime data of Camunda 8 Run ${version}`,
|
|
6283
|
+
error
|
|
6284
|
+
);
|
|
6285
|
+
}
|
|
6286
|
+
}
|
|
6287
|
+
try {
|
|
6288
|
+
await spawnC8ctl(ctx, ["cluster", "delete", version], {
|
|
6289
|
+
promoteStdoutLine: () => true,
|
|
6290
|
+
stderrPassthrough: true
|
|
6291
|
+
});
|
|
6292
|
+
} catch (error) {
|
|
6293
|
+
failures += 1;
|
|
6294
|
+
removalFailure(ctx, `remove Camunda 8 Run ${version}`, error);
|
|
6295
|
+
}
|
|
6141
6296
|
}
|
|
6142
6297
|
}
|
|
6143
6298
|
for (const { plan, servers } of inventory.mcp) {
|
|
@@ -6252,12 +6407,13 @@ async function applySetupRemoval(ctx, inventory, stopCluster) {
|
|
|
6252
6407
|
logger.info("Setup removal finished.", { essential: true });
|
|
6253
6408
|
}
|
|
6254
6409
|
}
|
|
6255
|
-
async function runSetupRemoval(ctx
|
|
6410
|
+
async function runSetupRemoval(ctx) {
|
|
6256
6411
|
const { logger } = ctx;
|
|
6257
6412
|
const inventory = await inspectSetupRemovalInventory({
|
|
6258
|
-
detectModeler: detectModelerRemoval
|
|
6413
|
+
detectModeler: detectModelerRemoval,
|
|
6414
|
+
detectClusterRunning
|
|
6259
6415
|
});
|
|
6260
|
-
const preview = setupRemovalPreview(inventory
|
|
6416
|
+
const preview = setupRemovalPreview(inventory);
|
|
6261
6417
|
const jsonMode = logger.mode === "json";
|
|
6262
6418
|
if (ctx.dryRun || jsonMode) {
|
|
6263
6419
|
logger.json({
|
|
@@ -6268,7 +6424,7 @@ async function runSetupRemoval(ctx, stopCluster) {
|
|
|
6268
6424
|
}
|
|
6269
6425
|
logger.output(preview.text);
|
|
6270
6426
|
if (preview.payload.items.length === 0) {
|
|
6271
|
-
if (inventory.mcpPlanningFailures.length > 0 || inventory.skillDiscoveryFailures.length > 0 || inventory.blueprintPlanningFailures.length > 0 || inventory.modelerInspectionFailure) {
|
|
6427
|
+
if (inventory.mcpPlanningFailures.length > 0 || inventory.skillDiscoveryFailures.length > 0 || inventory.blueprintPlanningFailures.length > 0 || inventory.modelerInspectionFailure || inventory.clusterInspectionFailure) {
|
|
6272
6428
|
process.exitCode = 1;
|
|
6273
6429
|
}
|
|
6274
6430
|
return;
|
|
@@ -6287,32 +6443,23 @@ async function runSetupRemoval(ctx, stopCluster) {
|
|
|
6287
6443
|
return;
|
|
6288
6444
|
}
|
|
6289
6445
|
} else if (!ctx.yes) {
|
|
6290
|
-
|
|
6291
|
-
"c8ctl",
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
...stopCluster ? ["--stop-cluster"] : [],
|
|
6295
|
-
"--yes"
|
|
6296
|
-
].join(" ");
|
|
6297
|
-
logger.info(`Nothing was removed. Run "${command}" to confirm.`, {
|
|
6298
|
-
essential: true
|
|
6299
|
-
});
|
|
6446
|
+
logger.info(
|
|
6447
|
+
'Nothing was removed. Run "c8ctl setup --remove --yes" to confirm.',
|
|
6448
|
+
{ essential: true }
|
|
6449
|
+
);
|
|
6300
6450
|
return;
|
|
6301
6451
|
}
|
|
6302
|
-
await applySetupRemoval(ctx, inventory
|
|
6452
|
+
await applySetupRemoval(ctx, inventory);
|
|
6303
6453
|
}
|
|
6304
6454
|
async function runSetup(ctx, flags) {
|
|
6305
6455
|
const { logger } = ctx;
|
|
6306
|
-
if (flags["stop-cluster"] && !flags.remove) {
|
|
6307
|
-
throw new Error("--stop-cluster can only be used with --remove.");
|
|
6308
|
-
}
|
|
6309
6456
|
if (flags.remove) {
|
|
6310
6457
|
if (flags.modeler || flags["no-modeler"] || flags["docs-mcp"]) {
|
|
6311
6458
|
throw new Error(
|
|
6312
6459
|
"--remove cannot be combined with --modeler, --no-modeler, or --docs-mcp."
|
|
6313
6460
|
);
|
|
6314
6461
|
}
|
|
6315
|
-
await runSetupRemoval(ctx
|
|
6462
|
+
await runSetupRemoval(ctx);
|
|
6316
6463
|
return;
|
|
6317
6464
|
}
|
|
6318
6465
|
if (ctx.dryRun) {
|
|
@@ -6437,12 +6584,23 @@ ${renderNextSteps(nextSteps, { color, maxWidth: process.stdout.columns || void 0
|
|
|
6437
6584
|
}
|
|
6438
6585
|
async function setupHandler(_args, flagsRecord, ctx) {
|
|
6439
6586
|
if (!ctx) throw new Error("setup requires the plugin host context");
|
|
6587
|
+
if (ctx.unrecognizedFlags?.includes("--stop-cluster")) {
|
|
6588
|
+
renderCommandFailure(
|
|
6589
|
+
ctx.logger,
|
|
6590
|
+
"Failed to setup",
|
|
6591
|
+
new Error(
|
|
6592
|
+
"--stop-cluster no longer exists: c8ctl setup --remove stops the local cluster and deletes its runtime data and downloaded Camunda 8 Run binaries after confirmation."
|
|
6593
|
+
),
|
|
6594
|
+
{ verbose: ctx.verbose }
|
|
6595
|
+
);
|
|
6596
|
+
process.exitCode = 1;
|
|
6597
|
+
return;
|
|
6598
|
+
}
|
|
6440
6599
|
const flags = {
|
|
6441
6600
|
modeler: flagsRecord?.modeler === true,
|
|
6442
6601
|
"no-modeler": flagsRecord?.["no-modeler"] === true,
|
|
6443
6602
|
"docs-mcp": flagsRecord?.["docs-mcp"] === true,
|
|
6444
|
-
remove: flagsRecord?.remove === true
|
|
6445
|
-
"stop-cluster": flagsRecord?.["stop-cluster"] === true
|
|
6603
|
+
remove: flagsRecord?.remove === true
|
|
6446
6604
|
};
|
|
6447
6605
|
try {
|
|
6448
6606
|
await runSetup(ctx, flags);
|
|
@@ -6465,9 +6623,7 @@ A run without a selection (piped output, CI) installs nothing unless you pass --
|
|
|
6465
6623
|
|
|
6466
6624
|
Exit code 0: every selected setup step succeeded, or nothing was installed for lack of a go-ahead (wizard cancelled with Escape; a piped, --quiet or JSON-mode run without --yes; --json or --dry-run printing the plan). Ctrl+C ends the wizard by signal (130 on POSIX shells). A re-run reuses finished work where possible; the deploy, process start and skills install repeat by design. Exit code 1: arguments failed validation, or a step failed \u2014 other eligible steps still ran, while dependents (and the deploy finale after any failure) were skipped.
|
|
6467
6625
|
|
|
6468
|
-
--remove shows setup-managed MCP entries, Camunda skills, a c8ctl-managed Desktop Modeler installation,
|
|
6469
|
-
|
|
6470
|
-
--stop-cluster is available only with --remove. It stops the local cluster without purging runtime data or deleting downloaded binaries.
|
|
6626
|
+
--remove shows setup-managed MCP entries, Camunda skills, a c8ctl-managed Desktop Modeler installation, marker-listed blueprint files, and the local cluster before removing them: the cluster is stopped, and its runtime data and downloaded binaries are deleted \u2014 setup-deployed process state goes with the runtime data. Confirm in the interactive prompt or pass --yes in non-interactive use. --json and --dry-run print only the removal preview. Removal runs the owning commands: cluster stop --purge plus per-version cluster purge and delete, mcp uninstall, skills uninstall, and modeler uninstall. Local edits in skill folders and listed blueprint files are removed; untracked blueprint files are kept. --remove cannot be combined with --modeler, --no-modeler, or --docs-mcp.
|
|
6471
6627
|
|
|
6472
6628
|
Removal exits 0 when every requested action succeeds, and 1 if any action fails; the other removal actions still run.`;
|
|
6473
6629
|
var metadata = {
|
|
@@ -6493,10 +6649,6 @@ var metadata = {
|
|
|
6493
6649
|
{
|
|
6494
6650
|
command: "c8ctl setup --remove --yes",
|
|
6495
6651
|
description: "Remove the previewed setup-managed components"
|
|
6496
|
-
},
|
|
6497
|
-
{
|
|
6498
|
-
command: "c8ctl setup --remove --stop-cluster --yes",
|
|
6499
|
-
description: "Also stop the local cluster without purging its data"
|
|
6500
6652
|
}
|
|
6501
6653
|
]
|
|
6502
6654
|
}
|
|
@@ -6519,11 +6671,7 @@ var commands = {
|
|
|
6519
6671
|
},
|
|
6520
6672
|
remove: {
|
|
6521
6673
|
type: "boolean",
|
|
6522
|
-
description: "Preview and remove setup-managed MCP entries, skills, Modeler, and
|
|
6523
|
-
},
|
|
6524
|
-
"stop-cluster": {
|
|
6525
|
-
type: "boolean",
|
|
6526
|
-
description: "With --remove, stop the local cluster without purging its data"
|
|
6674
|
+
description: "Preview and remove setup-managed MCP entries, skills, Modeler, blueprint files, and the local cluster"
|
|
6527
6675
|
}
|
|
6528
6676
|
},
|
|
6529
6677
|
handler: setupHandler
|