@camunda8/cli 4.7.0-alpha.23 → 4.7.0-alpha.25

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.
@@ -2283,7 +2283,6 @@ function renderCommandFailure(logger, message, error, { verbose = false } = {})
2283
2283
  var CHECK_INTERVAL_MS = 60 * 60 * 1e3;
2284
2284
 
2285
2285
  // src/utils/command-local/mcp-install-helpers.ts
2286
- import { randomUUID } from "node:crypto";
2287
2286
  import {
2288
2287
  closeSync,
2289
2288
  existsSync as existsSync2,
@@ -3971,47 +3970,6 @@ function skillRemovalLocation(skill, { env = process.env, home, platform: platfo
3971
3970
  function camundaSkillRemovalPath(skill, options = {}) {
3972
3971
  return skillRemovalLocation(skill, options).directory;
3973
3972
  }
3974
- function removeCamundaSkill(skill, options = {}) {
3975
- const { directory, root } = skillRemovalLocation(skill, options);
3976
- const directoryInfo = lstatSync(directory, { throwIfNoEntry: false });
3977
- if (!directoryInfo) return;
3978
- if (directoryInfo.isSymbolicLink()) {
3979
- const rootInfo2 = statSync(root, { throwIfNoEntry: false });
3980
- if (!rootInfo2?.isDirectory()) {
3981
- throw new Error(
3982
- `Cannot safely remove Camunda skill "${skill.name}": its user skills directory is unavailable.`
3983
- );
3984
- }
3985
- const rootRealPath2 = realpathSync(root);
3986
- const parentRealPath = realpathSync(dirname2(directory));
3987
- if (!isWithinPath(rootRealPath2, parentRealPath)) {
3988
- throw new Error(
3989
- `Cannot safely remove Camunda skill "${skill.name}": its parent directory resolves outside the user skills directory.`
3990
- );
3991
- }
3992
- unlinkSync(directory);
3993
- return;
3994
- }
3995
- if (!directoryInfo.isDirectory()) {
3996
- throw new Error(
3997
- `Cannot safely remove Camunda skill "${skill.name}": its listed path is not a directory.`
3998
- );
3999
- }
4000
- const rootInfo = statSync(root, { throwIfNoEntry: false });
4001
- if (!rootInfo?.isDirectory()) {
4002
- throw new Error(
4003
- `Cannot safely remove Camunda skill "${skill.name}": its user skills directory is unavailable.`
4004
- );
4005
- }
4006
- const rootRealPath = realpathSync(root);
4007
- const directoryRealPath = realpathSync(directory);
4008
- if (!isWithinPath(rootRealPath, directoryRealPath) || directoryRealPath === rootRealPath) {
4009
- throw new Error(
4010
- `Cannot safely remove Camunda skill "${skill.name}": its directory resolves outside the user skills directory.`
4011
- );
4012
- }
4013
- rmSync(directory, { recursive: true });
4014
- }
4015
3973
  function requireSuccessfulSkillCommand(result, action) {
4016
3974
  if (result.error) {
4017
3975
  const errorCode = "code" in result.error && typeof result.error.code === "string" ? result.error.code : void 0;
@@ -4328,64 +4286,6 @@ function planMcpConfigs({
4328
4286
  }
4329
4287
  return plans;
4330
4288
  }
4331
- function acquireConfigLock(targetPath, timeoutMs, retryMs) {
4332
- const lockPath = `${targetPath}.lock`;
4333
- const deadline = Date.now() + timeoutMs;
4334
- const waitSlot = new Int32Array(new SharedArrayBuffer(4));
4335
- for (; ; ) {
4336
- try {
4337
- closeSync(openSync(lockPath, "wx", 384));
4338
- return lockPath;
4339
- } catch (error) {
4340
- if (!(isRecord(error) && error.code === "EEXIST")) throw error;
4341
- if (Date.now() >= deadline) {
4342
- throw new Error(
4343
- `Another c8ctl process is updating ${targetPath}. Retry shortly, or remove the stale lock ${lockPath} if that process crashed.`
4344
- );
4345
- }
4346
- Atomics.wait(waitSlot, 0, 0, retryMs);
4347
- }
4348
- }
4349
- }
4350
- function writeMcpConfig(plan, options) {
4351
- if (!plan.changes.some(
4352
- (change) => change.status === "installed" || change.status === "updated" || change.status === "removed"
4353
- ))
4354
- return;
4355
- mkdirSync(dirname3(plan.targetPath), { recursive: true });
4356
- const lockPath = acquireConfigLock(
4357
- plan.targetPath,
4358
- options?.lockTimeoutMs ?? 5e3,
4359
- options?.lockRetryMs ?? 50
4360
- );
4361
- try {
4362
- const temp = `${plan.targetPath}.${randomUUID()}.tmp`;
4363
- let fd;
4364
- let created = false;
4365
- try {
4366
- fd = openSync(temp, "wx", 384);
4367
- created = true;
4368
- writeFileSync(fd, plan.content, "utf8");
4369
- if (process.platform !== "win32") fchmodSync(fd, plan.mode);
4370
- fsyncSync(fd);
4371
- closeSync(fd);
4372
- fd = void 0;
4373
- const current = readOptionalFile(plan.targetPath);
4374
- if (current === plan.content) return;
4375
- if (current !== plan.original) {
4376
- throw new Error(
4377
- `MCP config changed during installation: ${plan.path}. Run the command again.`
4378
- );
4379
- }
4380
- renameSync(temp, plan.targetPath);
4381
- } finally {
4382
- if (fd !== void 0) closeSync(fd);
4383
- if (created) rmSync2(temp, { force: true });
4384
- }
4385
- } finally {
4386
- rmSync2(lockPath, { force: true });
4387
- }
4388
- }
4389
4289
 
4390
4290
  // src/utils/command-local/process-instance-helpers.ts
4391
4291
  function extractProcessId(bpmnContent) {
@@ -4406,6 +4306,7 @@ import {
4406
4306
  writeFileSync as writeFileSync2
4407
4307
  } from "node:fs";
4408
4308
  import { dirname as dirname4, isAbsolute as isAbsolute2, join as join3, relative as relative2, resolve as resolve3, sep as sep2 } from "node:path";
4309
+ var ROCKET_LAUNCH_START_VARIABLES = { missionName: "Apollo", fuelLevel: 80 };
4409
4310
  var SETUP_BLUEPRINTS = [
4410
4311
  {
4411
4312
  id: "rocket-launch",
@@ -4419,19 +4320,25 @@ var SETUP_BLUEPRINTS = [
4419
4320
  path: "1-rocket-launch"
4420
4321
  },
4421
4322
  processFile: "rocket-launch.bpmn",
4422
- // The mission decision reads these; the upstream quick-start's
4423
- // "full send" launch.
4424
- startVariables: { missionName: "Apollo", fuelLevel: 80 },
4323
+ startVariables: ROCKET_LAUNCH_START_VARIABLES,
4425
4324
  // Fully automated: setup already deployed and launched an
4426
- // instance, so the next step is looking at it. The suggestion pins
4427
- // the local profile and its <default> tenant — the session's
4428
- // active profile and tenant may point elsewhere. Two lines: && is
4429
- // a syntax error in Windows PowerShell 5.1.
4430
- nextSteps: () => [
4431
- "A Rocket Launch instance is already running on the local cluster.",
4432
- "See it:",
4433
- ' c8ctl use tenant "<default>"',
4434
- " c8ctl search process-instance --profile local"
4325
+ // instance, so the next step is looking at it. The deeplink opens
4326
+ // the started instance in Operate directly — no filter clearing.
4327
+ // The CLI lines pin the local profile (the session's active
4328
+ // profile may point elsewhere) but not the tenant: the first-run
4329
+ // audience has no session tenant, so resolution already lands on
4330
+ // <default>. The rerun carries the same start variables setup
4331
+ // used, or the mission decision incidents; the JSON is
4332
+ // single-quoted, which cmd.exe does not strip — cmd users quote
4333
+ // the other way around. The run path is quoted: the working
4334
+ // directory may contain spaces. All lines stay printable ASCII so
4335
+ // the box keeps its borders.
4336
+ nextSteps: ({ projectDir, processInstanceKey }) => [
4337
+ "Process instance is running on the local cluster.",
4338
+ `Watch it: http://localhost:8080/operate/processes/${processInstanceKey}`,
4339
+ " (login using demo / demo as username / password)",
4340
+ `Inspect it: c8ctl get process-instance ${processInstanceKey} --profile local`,
4341
+ `Run again: c8ctl run "${join3(projectDir, "rocket-launch.bpmn")}" --profile local --variables '${JSON.stringify(ROCKET_LAUNCH_START_VARIABLES)}'`
4435
4342
  ]
4436
4343
  },
4437
4344
  {
@@ -4451,15 +4358,33 @@ var SETUP_BLUEPRINTS = [
4451
4358
  processFile: "bpmn/order-process.bpmn",
4452
4359
  // The started instance stalls at its first service task until a
4453
4360
  // worker connects — starting one is the whole point of the box.
4454
- // The path is quoted: the working directory may contain spaces.
4455
- // npm install and npm start are separate lines: && is a syntax
4456
- // error in Windows PowerShell 5.1.
4457
- nextSteps: (projectDir) => [
4458
- "The order process waits for a worker. Start one:",
4459
- ` cd "${join3(projectDir, "nodejs")}"`,
4460
- " npm install",
4461
- " npm start",
4462
- "Then watch the instance complete in Operate."
4361
+ // One block per shipped worker language. Node.js and Python cd
4362
+ // into the worker directory: a bare `npm install --prefix <dir>`
4363
+ // is misread by npm on Windows as a global install of the
4364
+ // caller's directory, and the Python worker needs a virtualenv —
4365
+ // pip into an externally managed system Python fails (PEP 668).
4366
+ // Java and C# can address the project directly: -f and --project
4367
+ // share neither defect. Paths are quoted (the working directory
4368
+ // may contain spaces), every command gets its own line (&& is a
4369
+ // syntax error in Windows PowerShell 5.1), and all lines stay
4370
+ // printable ASCII so the box keeps its borders.
4371
+ nextSteps: ({ projectDir, processInstanceKey }) => [
4372
+ "Process instance is running on the local cluster.",
4373
+ "It waits at the first service task until a worker connects.",
4374
+ `Open it: http://localhost:8080/operate/processes/${processInstanceKey}`,
4375
+ " (login using demo / demo as username / password)",
4376
+ "",
4377
+ "Start a worker in your language:",
4378
+ ` Node.js: cd "${join3(projectDir, "nodejs")}"`,
4379
+ " npm install",
4380
+ " npm start",
4381
+ ` Python: cd "${join3(projectDir, "python")}"`,
4382
+ " python -m venv .venv",
4383
+ " source .venv/bin/activate # Windows: .venv\\Scripts\\activate",
4384
+ " pip install -r requirements.txt",
4385
+ " python main.py",
4386
+ ` Java: mvn -f "${join3(projectDir, "java")}" spring-boot:run`,
4387
+ ` C#: dotnet run --project "${join3(projectDir, "csharp")}"`
4463
4388
  ]
4464
4389
  }
4465
4390
  ];
@@ -5487,7 +5412,8 @@ var SETUP_MCP_HARNESSES = [
5487
5412
  "vscode"
5488
5413
  ];
5489
5414
  async function inspectSetupRemovalInventory({
5490
- cwd = process.cwd()
5415
+ cwd = process.cwd(),
5416
+ detectModeler
5491
5417
  } = {}) {
5492
5418
  const mcpHarnesses = process.platform === "darwin" || process.platform === "win32" ? [...SETUP_MCP_HARNESSES, "claude-desktop"] : [...SETUP_MCP_HARNESSES];
5493
5419
  const mcpPlanningFailures = [];
@@ -5539,13 +5465,26 @@ async function inspectSetupRemovalInventory({
5539
5465
  });
5540
5466
  }
5541
5467
  });
5468
+ let modeler;
5469
+ let modelerInspectionFailure;
5470
+ if (detectModeler) {
5471
+ try {
5472
+ modeler = await detectModeler();
5473
+ } catch (error) {
5474
+ modelerInspectionFailure = {
5475
+ message: error instanceof Error ? error.message : String(error)
5476
+ };
5477
+ }
5478
+ }
5542
5479
  return {
5543
5480
  mcp,
5544
5481
  mcpPlanningFailures,
5545
5482
  skills,
5546
5483
  skillDiscoveryFailures,
5547
5484
  blueprints,
5548
- blueprintPlanningFailures
5485
+ blueprintPlanningFailures,
5486
+ modeler,
5487
+ modelerInspectionFailure
5549
5488
  };
5550
5489
  }
5551
5490
 
@@ -5653,6 +5592,77 @@ function spawnClusterStop(ctx) {
5653
5592
  stderrPassthrough: true
5654
5593
  });
5655
5594
  }
5595
+ function captureC8ctlJson(argv) {
5596
+ const label = `c8ctl ${argv.join(" ")}`;
5597
+ return new Promise((resolvePromise, rejectPromise) => {
5598
+ const child = spawn2(
5599
+ process.execPath,
5600
+ [...process.execArgv, CLI_ENTRY, ...argv],
5601
+ {
5602
+ stdio: ["ignore", "pipe", "pipe"],
5603
+ env: { ...process.env, C8CTL_OUTPUT_MODE: "json" }
5604
+ }
5605
+ );
5606
+ let stdout = "";
5607
+ let stderr = "";
5608
+ child.stdout?.setEncoding("utf-8");
5609
+ child.stderr?.setEncoding("utf-8");
5610
+ child.stdout?.on("data", (chunk) => {
5611
+ stdout += chunk;
5612
+ });
5613
+ child.stderr?.on("data", (chunk) => {
5614
+ stderr += chunk;
5615
+ });
5616
+ child.on(
5617
+ "error",
5618
+ (error) => rejectPromise(new Error(`Could not run ${label}: ${error.message}`))
5619
+ );
5620
+ child.on("close", (code) => {
5621
+ if (code !== 0) {
5622
+ const detail = stderr.trim();
5623
+ rejectPromise(
5624
+ new Error(
5625
+ `${label} failed (exit code ${code}).${detail ? ` ${detail}` : ""}`
5626
+ )
5627
+ );
5628
+ return;
5629
+ }
5630
+ try {
5631
+ resolvePromise(JSON.parse(stdout));
5632
+ } catch {
5633
+ rejectPromise(
5634
+ new Error(`${label} did not print a JSON payload: ${stdout.trim()}`)
5635
+ );
5636
+ }
5637
+ });
5638
+ });
5639
+ }
5640
+ async function detectModelerRemoval() {
5641
+ const payload = await captureC8ctlJson([
5642
+ "modeler",
5643
+ "remove",
5644
+ "--dry-run"
5645
+ ]);
5646
+ if (!isRecord(payload) || typeof payload.wouldChange !== "boolean") {
5647
+ throw new Error(
5648
+ 'modeler remove --dry-run returned an invalid response: expected a boolean "wouldChange" field.'
5649
+ );
5650
+ }
5651
+ if (!payload.wouldChange) return void 0;
5652
+ const removalTarget = payload.removalTarget;
5653
+ if (!isRecord(removalTarget) || typeof removalTarget.method !== "string" || removalTarget.method.length === 0 || typeof removalTarget.path !== "string" || removalTarget.path.length === 0) {
5654
+ throw new Error(
5655
+ 'modeler remove --dry-run returned an invalid response: expected a "removalTarget" object with nonempty "method" and "path".'
5656
+ );
5657
+ }
5658
+ return {
5659
+ message: typeof payload.message === "string" ? payload.message : "remove Camunda Desktop Modeler",
5660
+ target: {
5661
+ method: removalTarget.method,
5662
+ path: removalTarget.path
5663
+ }
5664
+ };
5665
+ }
5656
5666
  var CLUSTER_HEALTH_TIMEOUT_MS = 12e4;
5657
5667
  var CLUSTER_HEALTH_POLL_MS = 2e3;
5658
5668
  async function runClusterStart(ctx, run) {
@@ -5749,7 +5759,7 @@ async function runBlueprintDeploy(ctx, run) {
5749
5759
  }
5750
5760
  });
5751
5761
  logger.info(`Process instance created: ${created.processInstanceKey}`);
5752
- run.instanceStarted = true;
5762
+ run.processInstanceKey = created.processInstanceKey;
5753
5763
  }
5754
5764
  function stageLocalProfile(deployDataDir) {
5755
5765
  const profilesPath = join5(c8ctl2.getUserDataDir(), "profiles.json");
@@ -5960,6 +5970,11 @@ async function executePlan(ctx, selected, blueprintId, { color }) {
5960
5970
  }
5961
5971
  return { failures, run };
5962
5972
  }
5973
+ function modelerRemovalLine(message) {
5974
+ const match = /^Dry run: would remove (.+)$/.exec(message);
5975
+ if (match) return `Remove ${match[1]}`;
5976
+ return `Remove Camunda Desktop Modeler with \`c8ctl modeler remove\` (${message})`;
5977
+ }
5963
5978
  function setupRemovalPreview(inventory, stopCluster) {
5964
5979
  const items = [];
5965
5980
  const warnings = [];
@@ -5992,6 +6007,11 @@ function setupRemovalPreview(inventory, stopCluster) {
5992
6007
  warnings.push(warning);
5993
6008
  lines.push(` Warning: ${warning}`);
5994
6009
  }
6010
+ if (inventory.modelerInspectionFailure) {
6011
+ const warning = `Could not inspect the Camunda Desktop Modeler installation: ${inventory.modelerInspectionFailure.message}. Modeler was left untouched.`;
6012
+ warnings.push(warning);
6013
+ lines.push(` Warning: ${warning}`);
6014
+ }
5995
6015
  for (const failure of inventory.blueprintPlanningFailures) {
5996
6016
  const warning = `Could not inspect setup blueprint marker in ${failure.directory}: ${failure.message}. That project was left untouched.`;
5997
6017
  warnings.push(warning);
@@ -6008,6 +6028,14 @@ function setupRemovalPreview(inventory, stopCluster) {
6008
6028
  ` Remove Camunda skill "${skill.name}" for ${skill.harness} (${skill.path}; all contents will be removed)`
6009
6029
  );
6010
6030
  }
6031
+ if (inventory.modeler) {
6032
+ items.push({
6033
+ type: "modeler",
6034
+ action: "remove",
6035
+ message: inventory.modeler.message
6036
+ });
6037
+ lines.push(` ${modelerRemovalLine(inventory.modeler.message)}`);
6038
+ }
6011
6039
  for (const blueprint of inventory.blueprints) {
6012
6040
  const files = [.../* @__PURE__ */ new Set([...blueprint.files, ".c8ctl-blueprint.json"])];
6013
6041
  items.push({
@@ -6031,7 +6059,7 @@ function setupRemovalPreview(inventory, stopCluster) {
6031
6059
  if (items.length === 0)
6032
6060
  lines.push(" No setup-managed components were found.");
6033
6061
  lines.push(
6034
- " Listed skill directories and blueprint files may contain local edits; those contents will be removed. Untracked blueprint files and Desktop Modeler are not removed."
6062
+ " Listed skill directories and blueprint files may contain local edits; those contents will be removed. Untracked blueprint files are kept."
6035
6063
  );
6036
6064
  lines.push("Nothing was removed.");
6037
6065
  return {
@@ -6051,7 +6079,7 @@ function removalFailure(ctx, action, error) {
6051
6079
  }
6052
6080
  async function applySetupRemoval(ctx, inventory, stopCluster) {
6053
6081
  const { logger } = ctx;
6054
- let failures = inventory.mcpPlanningFailures.length + inventory.skillDiscoveryFailures.length + inventory.blueprintPlanningFailures.length;
6082
+ let failures = inventory.mcpPlanningFailures.length + inventory.skillDiscoveryFailures.length + inventory.blueprintPlanningFailures.length + (inventory.modelerInspectionFailure ? 1 : 0);
6055
6083
  for (const failure of inventory.mcpPlanningFailures) {
6056
6084
  logger.error(
6057
6085
  `Could not inspect MCP configuration for ${failure.harness}: ${failure.message}. That configuration was left untouched.`
@@ -6067,6 +6095,11 @@ async function applySetupRemoval(ctx, inventory, stopCluster) {
6067
6095
  `Could not inspect setup blueprint marker in ${failure.directory}: ${failure.message}. That project was left untouched.`
6068
6096
  );
6069
6097
  }
6098
+ if (inventory.modelerInspectionFailure) {
6099
+ logger.error(
6100
+ `Could not inspect the Camunda Desktop Modeler installation: ${inventory.modelerInspectionFailure.message}. Modeler was left untouched.`
6101
+ );
6102
+ }
6070
6103
  if (stopCluster) {
6071
6104
  try {
6072
6105
  await spawnClusterStop(ctx);
@@ -6080,8 +6113,19 @@ async function applySetupRemoval(ctx, inventory, stopCluster) {
6080
6113
  }
6081
6114
  }
6082
6115
  for (const { plan, servers } of inventory.mcp) {
6116
+ if (servers.length === 0) continue;
6117
+ const targets = [
6118
+ servers.includes("camunda-docs") ? "--docs" : void 0,
6119
+ servers.some((server) => server !== "camunda-docs") ? "--orchestration" : void 0
6120
+ ].filter((flag) => flag !== void 0);
6083
6121
  try {
6084
- writeMcpConfig(plan);
6122
+ await spawnC8ctl(
6123
+ ctx,
6124
+ ["mcp", "uninstall", plan.harness, ...targets],
6125
+ // stderr stays visible: a failing child's diagnostics are
6126
+ // otherwise suppressed with the rest of the quiet output.
6127
+ { skipStdoutLine: () => true, stderrPassthrough: true }
6128
+ );
6085
6129
  for (const server of servers) {
6086
6130
  logger.info(
6087
6131
  `Removed MCP server "${server}" for ${plan.harness} from ${plan.path}.`,
@@ -6097,20 +6141,53 @@ async function applySetupRemoval(ctx, inventory, stopCluster) {
6097
6141
  );
6098
6142
  }
6099
6143
  }
6100
- for (const skill of inventory.skills) {
6144
+ for (const harness of new Set(
6145
+ inventory.skills.map((skill) => skill.harness)
6146
+ )) {
6147
+ const skills = inventory.skills.filter(
6148
+ (skill) => skill.harness === harness
6149
+ );
6150
+ const names = skills.map((skill) => skill.name);
6151
+ const skillPaths = skills.flatMap((skill) => ["--skill-path", skill.path]);
6101
6152
  try {
6102
- removeCamundaSkill(skill);
6103
- logger.info(
6104
- `Removed Camunda skill "${skill.name}" for ${skill.harness} (${skill.path}).`,
6105
- { essential: true }
6153
+ await spawnC8ctl(
6154
+ ctx,
6155
+ [
6156
+ "skills",
6157
+ "remove",
6158
+ ...names,
6159
+ "--harness",
6160
+ harness,
6161
+ ...skillPaths,
6162
+ "--yes"
6163
+ ],
6164
+ {
6165
+ skipStdoutLine: (line) => line === "Skills removal preview:" || line.startsWith(" Remove Camunda skill") || line === "Skills removal finished.",
6166
+ promoteStdoutLine: (line) => line.startsWith("Removed Camunda skill"),
6167
+ stderrPassthrough: true
6168
+ }
6106
6169
  );
6107
6170
  } catch (error) {
6108
6171
  failures += 1;
6109
- removalFailure(
6110
- ctx,
6111
- `remove Camunda skill "${skill.name}" for ${skill.harness}`,
6112
- error
6113
- );
6172
+ removalFailure(ctx, `remove Camunda skills for ${harness}`, error);
6173
+ }
6174
+ }
6175
+ if (inventory.modeler) {
6176
+ try {
6177
+ await spawnC8ctl(ctx, ["modeler", "remove"], {
6178
+ promoteStdoutLine: (line) => line.includes("Modeler"),
6179
+ // Registration-cleanup warnings and failure diagnostics ride
6180
+ // stderr — keep them visible in quiet removal runs.
6181
+ stderrPassthrough: true,
6182
+ extraEnv: {
6183
+ C8CTL_SETUP_MODELER_REMOVAL_TARGET: JSON.stringify(
6184
+ inventory.modeler.target
6185
+ )
6186
+ }
6187
+ });
6188
+ } catch (error) {
6189
+ failures += 1;
6190
+ removalFailure(ctx, "remove Camunda Desktop Modeler", error);
6114
6191
  }
6115
6192
  }
6116
6193
  for (const blueprint of inventory.blueprints) {
@@ -6149,7 +6226,9 @@ async function applySetupRemoval(ctx, inventory, stopCluster) {
6149
6226
  }
6150
6227
  async function runSetupRemoval(ctx, stopCluster) {
6151
6228
  const { logger } = ctx;
6152
- const inventory = await inspectSetupRemovalInventory();
6229
+ const inventory = await inspectSetupRemovalInventory({
6230
+ detectModeler: detectModelerRemoval
6231
+ });
6153
6232
  const preview = setupRemovalPreview(inventory, stopCluster);
6154
6233
  const jsonMode = logger.mode === "json";
6155
6234
  if (ctx.dryRun || jsonMode) {
@@ -6161,7 +6240,7 @@ async function runSetupRemoval(ctx, stopCluster) {
6161
6240
  }
6162
6241
  logger.output(preview.text);
6163
6242
  if (preview.payload.items.length === 0) {
6164
- if (inventory.mcpPlanningFailures.length > 0 || inventory.skillDiscoveryFailures.length > 0 || inventory.blueprintPlanningFailures.length > 0) {
6243
+ if (inventory.mcpPlanningFailures.length > 0 || inventory.skillDiscoveryFailures.length > 0 || inventory.blueprintPlanningFailures.length > 0 || inventory.modelerInspectionFailure) {
6165
6244
  process.exitCode = 1;
6166
6245
  }
6167
6246
  return;
@@ -6292,8 +6371,13 @@ async function runSetup(ctx, flags) {
6292
6371
  const blueprint = setupBlueprintById(
6293
6372
  run.blueprintId ?? SETUP_BLUEPRINTS[0].id
6294
6373
  );
6295
- if (run.instanceStarted) {
6296
- nextSteps.push(...blueprint.nextSteps(run.blueprintDir));
6374
+ if (run.processInstanceKey !== void 0) {
6375
+ nextSteps.push(
6376
+ ...blueprint.nextSteps({
6377
+ projectDir: run.blueprintDir,
6378
+ processInstanceKey: run.processInstanceKey
6379
+ })
6380
+ );
6297
6381
  }
6298
6382
  nextSteps.push(`Project: ${run.blueprintDir}`);
6299
6383
  nextSteps.push(`Guide: ${blueprint.guideUrl}`);
@@ -6353,7 +6437,7 @@ A run without a selection (piped output, CI) installs nothing unless you pass --
6353
6437
 
6354
6438
  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.
6355
6439
 
6356
- --remove shows setup-managed MCP entries, Camunda skills, and marker-listed blueprint files before removing them. Confirm in the interactive prompt or pass --yes in non-interactive use. --json and --dry-run print only the removal preview. Local edits in skill folders and listed blueprint files are removed; untracked blueprint files are kept. Desktop Modeler is not removed. --remove cannot be combined with --modeler, --no-modeler, or --docs-mcp.
6440
+ --remove shows setup-managed MCP entries, Camunda skills, a c8ctl-managed Desktop Modeler installation, and marker-listed blueprint files before removing them. 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: mcp uninstall, skills remove, and modeler remove. 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.
6357
6441
 
6358
6442
  --stop-cluster is available only with --remove. It stops the local cluster without purging runtime data or deleting downloaded binaries.
6359
6443
 
@@ -6407,7 +6491,7 @@ var commands = {
6407
6491
  },
6408
6492
  remove: {
6409
6493
  type: "boolean",
6410
- description: "Preview and remove setup-managed MCP entries, skills, and blueprint files"
6494
+ description: "Preview and remove setup-managed MCP entries, skills, Modeler, and blueprint files"
6411
6495
  },
6412
6496
  "stop-cluster": {
6413
6497
  type: "boolean",
@@ -12,8 +12,13 @@ harnesses.
12
12
  GitHub CLI agent ID.
13
13
  - `c8ctl skills list [--harness <agent-id>]` — list installed Camunda skills
14
14
  and their harnesses and paths.
15
- - `c8ctl skills remove [--harness <agent-id>]` — preview and remove installed
16
- Camunda skills from the detected harnesses or one selected harness.
15
+ - `c8ctl skills remove [name...] [--skill-path <path>...] [--harness <agent-id>]`
16
+ — preview and remove installed Camunda skills from the detected harnesses
17
+ or one selected harness. Naming skills removes matching installations; an
18
+ unknown name fails before anything is deleted. To select one installation
19
+ when a name exists at multiple paths, pair each positional name with one
20
+ `--skill-path` value in the same order. Unknown name/path pairs fail before
21
+ anything is deleted.
17
22
 
18
23
  Requires GitHub CLI 2.90 or later; its skill commands are in preview.
19
24
  Re-run to update the same skill directories without duplicates when upstream
@@ -23,5 +28,7 @@ Without `--harness`, c8ctl detects Claude Code and GitHub Copilot CLI. Pass
23
28
  `--yes` to confirm removal in non-interactive use. `--dry-run` prints a removal
24
29
  preview without deleting files. Removal deletes the full Camunda skill
25
30
  directories, including local edits, and leaves other skills untouched.
31
+ Without `--skill-path`, a name selects every matching installation. When
32
+ `--skill-path` is provided, each name is limited to its matching listed path.
26
33
 
27
34
  Supports the global `--dry-run`, `--json`, `--quiet`, and `--verbose` flags.