@camunda8/cli 4.7.0-alpha.32 → 4.7.0-alpha.34

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.
@@ -83,6 +83,18 @@ patch releases.
83
83
  If the download server is unreachable, the aliases fall back to the values
84
84
  shipped in the plugin's `package.json`.
85
85
 
86
+ `stable` never launches a prerelease build. If the install for its version
87
+ still holds an alpha build (for example, a `8.11` install made through `alpha`
88
+ before 8.11 went GA), `start` and `install` download the GA build and replace
89
+ it. The GA build is extracted and checked in a staging directory first, so if
90
+ the download or extraction fails, the archive still holds a prerelease, or
91
+ another c8ctl has started that build in the meantime, the alpha build is kept.
92
+ When the download fails, the error says that only a prerelease build is
93
+ installed. A prerelease build that has cluster data, or an install that has
94
+ lost its launcher but still holds data, is never replaced automatically,
95
+ because that would delete the data: keep using a prerelease build with
96
+ `c8ctl cluster start <version>`, or run `c8ctl cluster purge <version>` first.
97
+
86
98
  ### Resilient running-state tracking
87
99
 
88
100
  A running cluster is tracked both by c8run's own `.process` pidfiles (which live
@@ -27,7 +27,7 @@ import {
27
27
  import { once } from 'node:events';
28
28
  import { chmod } from 'node:fs/promises';
29
29
  import { homedir, platform as osPlatform, arch as osArch } from 'node:os';
30
- import { join, dirname, basename, isAbsolute, resolve } from 'node:path';
30
+ import { join, dirname, basename, isAbsolute, relative, resolve } from 'node:path';
31
31
  import { finished } from 'node:stream/promises';
32
32
  import { StringDecoder } from 'node:string_decoder';
33
33
  import { fileURLToPath } from 'node:url';
@@ -232,9 +232,9 @@ function readLocalAliasMapping(cacheDir, alias) {
232
232
  */
233
233
  function findInstalledAliasTarget(cacheDir, value, alias) {
234
234
  const accepts = (version) => {
235
- const binaryPath = findC8RunBinaryPath({ cacheDir, version });
236
- if (!binaryPath) return false;
237
- return alias !== 'stable' || !isPrereleaseBuild(basename(dirname(binaryPath)));
235
+ const build = installedBuildName(cacheDir, version);
236
+ if (!build) return false;
237
+ return alias !== 'stable' || !isPrereleaseBuild(build);
238
238
  };
239
239
 
240
240
  if (accepts(value)) return value;
@@ -257,6 +257,94 @@ function isPrereleaseBuild(buildDirName) {
257
257
  return /^c8run-\d+\.\d+(\.\d+)?-/.test(buildDirName);
258
258
  }
259
259
 
260
+ /**
261
+ * Every cluster data dir in an install: `camunda-data` and the `data` dir
262
+ * inside each `camunda-zeebe-` dir, beside any launcher in the install dir
263
+ * or one of its immediate subdirs (older builds of a rolling install, or an
264
+ * install that lost its launcher). `cluster purge` deletes exactly these, and
265
+ * `stable` refuses to replace an install that still has any.
266
+ */
267
+ function findClusterDataDirs(installDir) {
268
+ const listDirs = (dir) => {
269
+ try {
270
+ return readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory());
271
+ } catch {
272
+ return [];
273
+ }
274
+ };
275
+ const roots = [installDir, ...listDirs(installDir).map((entry) => join(installDir, entry.name))];
276
+ const found = [];
277
+ for (const root of roots) {
278
+ const camundaData = join(root, 'camunda-data');
279
+ if (existsSync(camundaData)) found.push(camundaData);
280
+ for (const entry of listDirs(root)) {
281
+ const journal = join(root, entry.name, 'data');
282
+ if (entry.name.startsWith('camunda-zeebe-') && existsSync(journal)) found.push(journal);
283
+ }
284
+ }
285
+ return found;
286
+ }
287
+
288
+ /**
289
+ * Refuse to replace a `stable` install whose cluster data would be deleted:
290
+ * a prerelease build, or an install that lost its launcher. Data may sit
291
+ * beside the launcher or, without one, in the install dir or a subdir of it.
292
+ * A GA build is replaced like any rolling update.
293
+ */
294
+ function refuseIfClusterDataAtRisk(config) {
295
+ const version = config.version;
296
+ const installDir = join(config.cacheDir, `c8run-${version}`);
297
+ if (!existsSync(installDir)) return;
298
+ const build = installedBuildName(config.cacheDir, version);
299
+ if (build && !isPrereleaseBuild(build)) return;
300
+
301
+ if (findClusterDataDirs(installDir).length === 0) return;
302
+
303
+ const state = build
304
+ ? `holds a prerelease build (${build.slice('c8run-'.length)}) with cluster data`
305
+ : 'has cluster data but no c8run launcher';
306
+ const options = build
307
+ ? `Keep using it with "c8ctl cluster start ${version}", or delete its data with`
308
+ : 'Delete its data with';
309
+ throw new Error(
310
+ `c8run ${version} ${state}. "stable" needs a GA build, and replacing this install would delete that data. ` +
311
+ `${options} "c8ctl cluster purge ${version}" and run this command again.`,
312
+ );
313
+ }
314
+
315
+ /** Name of the build dir whose c8run would launch for `version` (e.g. "c8run-8.10.0-alpha1"), or null. */
316
+ function installedBuildName(cacheDir, version) {
317
+ const binaryPath = findC8RunBinaryPath({ cacheDir, version });
318
+ return binaryPath ? basename(dirname(binaryPath)) : null;
319
+ }
320
+
321
+ /** The prerelease build installed for `version`, or null when none is installed or it is GA. */
322
+ function installedPrereleaseBuild(cacheDir, version) {
323
+ const build = installedBuildName(cacheDir, version);
324
+ return build && isPrereleaseBuild(build) ? build : null;
325
+ }
326
+
327
+ /**
328
+ * Explain why `stable` has no usable local install when the version it would
329
+ * resolve to only holds a prerelease build — either `version` itself or the
330
+ * cached `stable` mapping (which resolution skips for that reason). Null otherwise.
331
+ */
332
+ function describePrereleaseOnlyStable(cacheDir, version) {
333
+ let cached = null;
334
+ try {
335
+ cached = readFileSync(getAliasMappingPath(cacheDir, 'stable'), 'utf-8').trim();
336
+ } catch {
337
+ // No cached mapping
338
+ }
339
+ for (const candidate of [version, cached]) {
340
+ const build = candidate && installedPrereleaseBuild(cacheDir, candidate);
341
+ if (build) {
342
+ return `Only a prerelease build of ${candidate} is installed (${build.slice('c8run-'.length)}); "stable" needs a GA build.`;
343
+ }
344
+ }
345
+ return null;
346
+ }
347
+
260
348
  /** Persist an alias mapping. Returns false if it could not be written. */
261
349
  export function storeLocalAliasMapping(cacheDir, alias, resolved) {
262
350
  try {
@@ -1555,7 +1643,18 @@ export async function hasNewerVersionAvailable(config) {
1555
1643
  export async function ensureC8RunInstalled(config) {
1556
1644
  const logger = getLogger();
1557
1645
 
1558
- if (isC8RunInstalled(config)) {
1646
+ // `stable` must never launch a prerelease, e.g. a rolling dir still holding
1647
+ // the alpha build installed through `alpha` before that minor went GA.
1648
+ const prereleaseBuild = config.requireGA ? installedPrereleaseBuild(config.cacheDir, config.version) : null;
1649
+ // Checked before downloading anything, and again right before the swap.
1650
+ if (config.requireGA) refuseIfClusterDataAtRisk(config);
1651
+
1652
+ if (prereleaseBuild) {
1653
+ logger.info(
1654
+ `c8run ${config.version} holds a prerelease build (${prereleaseBuild.slice('c8run-'.length)}); ` +
1655
+ '"stable" needs a GA build, so it will be replaced.',
1656
+ );
1657
+ } else if (isC8RunInstalled(config)) {
1559
1658
  if (config.checkForUpdates) {
1560
1659
  // Explicitly asked to check for updates (e.g. install subcommand with a rolling version)
1561
1660
  const hasUpdate = await hasNewerVersionAvailable(config);
@@ -1573,7 +1672,9 @@ export async function ensureC8RunInstalled(config) {
1573
1672
  'Stop it first with "c8ctl cluster stop", then re-run the install.',
1574
1673
  );
1575
1674
  }
1576
- purgeInstalledVersion(config);
1675
+ // stable is replaced via a staged swap after the new build is validated,
1676
+ // so a rejected archive never leaves it without a usable install.
1677
+ if (!config.requireGA) purgeInstalledVersion(config);
1577
1678
  } else {
1578
1679
  // Use local installation as-is (start subcommand, or pinned version)
1579
1680
  logger.info(`c8run ${config.version} is already installed.`);
@@ -1613,20 +1714,34 @@ export async function ensureC8RunInstalled(config) {
1613
1714
  );
1614
1715
  }
1615
1716
 
1616
- logger.info('No local installation found. Setting up...');
1717
+ if (!isC8RunInstalled(config)) logger.info('No local installation found. Setting up...');
1617
1718
 
1618
- const { archivePath, etag } = await downloadC8Run(config);
1719
+ let download;
1720
+ try {
1721
+ download = await downloadC8Run(config);
1722
+ } catch (error) {
1723
+ const note = config.requireGA && describePrereleaseOnlyStable(config.cacheDir, config.version);
1724
+ if (note) throw new Error(`${note} ${error?.message ?? error}`, { cause: error?.cause });
1725
+ throw error;
1726
+ }
1727
+ const { archivePath, etag } = download;
1619
1728
 
1620
1729
  const installDir = join(config.cacheDir, `c8run-${config.version}`);
1621
- await extractArchive(archivePath, installDir);
1730
+
1731
+ if (config.requireGA) {
1732
+ await installGABuild(config, archivePath, installDir);
1733
+ } else {
1734
+ await extractArchive(archivePath, installDir);
1735
+ }
1622
1736
 
1623
1737
  // Clean up the downloaded archive to save disk space
1624
1738
  if (existsSync(archivePath)) {
1625
1739
  rmSync(archivePath);
1626
1740
  }
1627
1741
 
1628
- const binaryPath = getC8RunBinaryPath(config);
1629
- await chmod(binaryPath, 0o755);
1742
+ if (!config.requireGA) {
1743
+ await chmod(getC8RunBinaryPath(config), 0o755);
1744
+ }
1630
1745
 
1631
1746
  // Store the ETag for rolling versions so future checks can detect new releases
1632
1747
  if (config.isRolling && etag) {
@@ -1636,6 +1751,64 @@ export async function ensureC8RunInstalled(config) {
1636
1751
  logger.info(`c8run ${config.version} installed successfully.`);
1637
1752
  }
1638
1753
 
1754
+ /**
1755
+ * Install the archive for `stable` without ever leaving a prerelease or
1756
+ * nothing in place: extract into a staging dir, require a GA launcher there,
1757
+ * then swap it in. Any failure before the swap leaves the existing install
1758
+ * (e.g. a usable alpha build) untouched.
1759
+ */
1760
+ async function installGABuild(config, archivePath, installDir) {
1761
+ const logger = getLogger();
1762
+ const stagingRoot = join(config.cacheDir, `.staging-c8run-${config.version}-${process.pid}`);
1763
+ const stagedDir = join(stagingRoot, `c8run-${config.version}`);
1764
+ // Dot-prefixed so neither dir is ever listed as an installed version ("c8run-*").
1765
+ const backupDir = join(config.cacheDir, `.replaced-c8run-${config.version}-${process.pid}`);
1766
+ rmSync(stagingRoot, { recursive: true, force: true });
1767
+
1768
+ try {
1769
+ await extractArchive(archivePath, stagedDir);
1770
+ const stagedBinary = findC8RunBinaryPath({ cacheDir: stagingRoot, version: config.version });
1771
+ if (!stagedBinary) {
1772
+ throw new Error(`The downloaded c8run ${config.version} archive does not contain a c8run launcher.`);
1773
+ }
1774
+ const stagedBuild = basename(dirname(stagedBinary));
1775
+ if (isPrereleaseBuild(stagedBuild)) {
1776
+ throw new Error(
1777
+ `The downloaded c8run ${config.version} is a prerelease build (${stagedBuild.slice('c8run-'.length)}); ` +
1778
+ '"stable" needs a GA build. Try again once the GA build is published, or start an explicit GA version.',
1779
+ );
1780
+ }
1781
+ await chmod(stagedBinary, 0o755);
1782
+
1783
+ // Rechecked here: another c8ctl may have started this version during the download.
1784
+ if (isVersionInstanceRunning(config.cacheDir, config.version)) {
1785
+ throw new Error(
1786
+ `Refusing to replace c8run ${config.version}: an instance started from it is still running. ` +
1787
+ 'Stop it first with "c8ctl cluster stop".',
1788
+ );
1789
+ }
1790
+
1791
+ // Rechecked here too: data may have been created during the download.
1792
+ refuseIfClusterDataAtRisk(config);
1793
+
1794
+ const replacing = existsSync(installDir);
1795
+ if (replacing) {
1796
+ logger.info(`Replacing the existing c8run ${config.version} build...`);
1797
+ rmSync(backupDir, { recursive: true, force: true });
1798
+ renameSync(installDir, backupDir);
1799
+ }
1800
+ try {
1801
+ renameSync(stagedDir, installDir);
1802
+ } catch (error) {
1803
+ if (replacing) renameSync(backupDir, installDir);
1804
+ throw error;
1805
+ }
1806
+ if (replacing) rmSync(backupDir, { recursive: true, force: true });
1807
+ } finally {
1808
+ rmSync(stagingRoot, { recursive: true, force: true });
1809
+ }
1810
+ }
1811
+
1639
1812
  // ---------------------------------------------------------------------------
1640
1813
  // Process management
1641
1814
  // ---------------------------------------------------------------------------
@@ -3273,48 +3446,19 @@ export async function purgeClusterData(cacheDir, versionSpec) {
3273
3446
  process.exit(1);
3274
3447
  }
3275
3448
 
3276
- const config = { cacheDir, version: resolvedVersion };
3277
3449
  const installDir = join(cacheDir, `c8run-${resolvedVersion}`);
3278
3450
  if (!existsSync(installDir)) {
3279
3451
  logger.error(`Version ${resolvedVersion} is not installed locally.`);
3280
3452
  process.exit(1);
3281
3453
  }
3282
3454
 
3283
- // Runtime data normally sits next to the c8run binary. If the binary itself
3284
- // is missing but the install dir survives — a partial/corrupt install, or the
3285
- // orphan case where the binary was removed out from under a running cluster
3286
- // (#560) — fall back to scanning the install dir and its immediate subdirs so
3287
- // leftover data is still purged instead of being silently left behind.
3288
- const binaryPath = findC8RunBinaryPath(config);
3289
- const dataRoots = binaryPath
3290
- ? [dirname(binaryPath)]
3291
- : [
3292
- installDir,
3293
- ...readdirSync(installDir, { withFileTypes: true })
3294
- .filter((entry) => entry.isDirectory())
3295
- .map((entry) => join(installDir, entry.name)),
3296
- ];
3297
-
3455
+ // Not only beside the launcher that would run: an older build of a rolling
3456
+ // install, or an install that lost its launcher, can hold data too, and
3457
+ // `stable` refuses to replace an install while any of it is left.
3298
3458
  const deleted = [];
3299
- for (const dataRoot of dataRoots) {
3300
- // Delete camunda-data (history data + application state)
3301
- const camundaDataDir = join(dataRoot, 'camunda-data');
3302
- if (existsSync(camundaDataDir)) {
3303
- rmSync(camundaDataDir, { recursive: true });
3304
- deleted.push('camunda-data');
3305
- }
3306
-
3307
- // Delete Zeebe journal data inside camunda-zeebe-* subdirectory
3308
- if (existsSync(dataRoot)) {
3309
- for (const entry of readdirSync(dataRoot, { withFileTypes: true })) {
3310
- if (!entry.isDirectory() || !entry.name.startsWith('camunda-zeebe-')) continue;
3311
- const dataDir = join(dataRoot, entry.name, 'data');
3312
- if (existsSync(dataDir)) {
3313
- rmSync(dataDir, { recursive: true });
3314
- deleted.push(join(entry.name, 'data'));
3315
- }
3316
- }
3317
- }
3459
+ for (const dataDir of findClusterDataDirs(installDir)) {
3460
+ rmSync(dataDir, { recursive: true });
3461
+ deleted.push(relative(installDir, dataDir));
3318
3462
  }
3319
3463
 
3320
3464
  if (deleted.length > 0) {
@@ -3899,6 +4043,8 @@ export const commands = {
3899
4043
  checkForUpdateHint: parsed.subcommand === 'start' && rolling,
3900
4044
  // --verbose: detailed HTTP diagnostics for the c8run download
3901
4045
  verbose: ctx?.verbose === true,
4046
+ // stable: reject (and replace) an install whose build is a prerelease
4047
+ requireGA: versionSpec === 'stable',
3902
4048
  };
3903
4049
 
3904
4050
  // For start with a named alias, check in the background whether the
@@ -6,12 +6,11 @@ development.
6
6
  ## Commands
7
7
 
8
8
  - `c8ctl setup` — the guided wizard: start a local cluster (downloading
9
- Camunda 8 Run on first run), install Desktop Modeler, create a starter
10
- project from a blueprint, deploy and run it, and set up AI assistant
11
- tooling (skills, MCP servers). Nothing is installed without a selection or
12
- `--yes`.
13
- - `c8ctl setup --yes` — set up the defaults without prompting (Rocket Launch
14
- blueprint).
9
+ Camunda 8 Run on first run), install Desktop Modeler, create the Rocket
10
+ Launch example, deploy and run it, and set up AI assistant tooling (skills,
11
+ MCP servers). Nothing is installed without a selection or `--yes`.
12
+ - `c8ctl setup --yes` — set up the defaults without prompting, including the
13
+ Rocket Launch example.
15
14
  - `c8ctl setup --remove` — preview and remove setup-managed MCP entries,
16
15
  Camunda skills, a c8ctl-managed Desktop Modeler installation, blueprint
17
16
  files, and the local cluster: the cluster is stopped, and its runtime
@@ -4560,7 +4560,6 @@ var SETUP_BLUEPRINTS = [
4560
4560
  {
4561
4561
  id: "rocket-launch",
4562
4562
  name: "Rocket Launch",
4563
- description: "A fully automated hello-world process with a decision.",
4564
4563
  guideUrl: "https://docs.camunda.io/docs/guides/getting-started-hello-world/",
4565
4564
  source: {
4566
4565
  owner: "camunda",
@@ -4589,52 +4588,6 @@ var SETUP_BLUEPRINTS = [
4589
4588
  `Inspect it: c8ctl get process-instance ${processInstanceKey} --profile local`,
4590
4589
  `Run again: c8ctl run "${join4(projectDir, "rocket-launch.bpmn")}" --profile local --variables '${JSON.stringify(ROCKET_LAUNCH_START_VARIABLES)}'`
4591
4590
  ]
4592
- },
4593
- {
4594
- id: "service-worker",
4595
- name: "Service worker",
4596
- description: "An order process with service worker implementations.",
4597
- guideUrl: "https://docs.camunda.io/docs/guides/getting-started-example/",
4598
- source: {
4599
- owner: "camunda",
4600
- repo: "camunda-8-get-started",
4601
- ref: "main",
4602
- path: "2-order-process-with-service-workers"
4603
- },
4604
- // The worker implementations each embed a copy of the model; only
4605
- // the bpmn/ directory is deployed.
4606
- deployPath: "bpmn",
4607
- processFile: "bpmn/order-process.bpmn",
4608
- // The started instance stalls at its first service task until a
4609
- // worker connects — starting one is the whole point of the box.
4610
- // One block per shipped worker language. Node.js and Python cd
4611
- // into the worker directory: a bare `npm install --prefix <dir>`
4612
- // is misread by npm on Windows as a global install of the
4613
- // caller's directory, and the Python worker needs a virtualenv —
4614
- // pip into an externally managed system Python fails (PEP 668).
4615
- // Java and C# can address the project directly: -f and --project
4616
- // share neither defect. Paths are quoted (the working directory
4617
- // may contain spaces), every command gets its own line (&& is a
4618
- // syntax error in Windows PowerShell 5.1), and all lines stay
4619
- // printable ASCII so the box keeps its borders.
4620
- nextSteps: ({ projectDir, processInstanceKey }) => [
4621
- "Process instance is running on the local cluster.",
4622
- "It waits at the first service task until a worker connects.",
4623
- `Open it: http://localhost:8080/operate/processes/${processInstanceKey}`,
4624
- " (login using demo / demo as username / password)",
4625
- "",
4626
- "Start a worker in your language:",
4627
- ` Node.js: cd "${join4(projectDir, "nodejs")}"`,
4628
- " npm install",
4629
- " npm start",
4630
- ` Python: cd "${join4(projectDir, "python")}"`,
4631
- " python -m venv .venv",
4632
- " source .venv/bin/activate # Windows: .venv\\Scripts\\activate",
4633
- " pip install -r requirements.txt",
4634
- " python main.py",
4635
- ` Java: mvn -f "${join4(projectDir, "java")}" spring-boot:run`,
4636
- ` C#: dotnet run --project "${join4(projectDir, "csharp")}"`
4637
- ]
4638
4591
  }
4639
4592
  ];
4640
4593
  var BlueprintScaffoldError = class extends Error {
@@ -4826,14 +4779,6 @@ function readRemovalMarker(directory) {
4826
4779
  { hint: "Repair or remove the marker manually before trying again." }
4827
4780
  );
4828
4781
  }
4829
- const blueprint = SETUP_BLUEPRINTS.find(
4830
- (candidate) => candidate.id === value.id
4831
- );
4832
- if (!blueprint) {
4833
- throw new BlueprintScaffoldError(
4834
- `Cannot safely remove the blueprint in ${directory}: "${value.id}" is not a supported setup blueprint.`
4835
- );
4836
- }
4837
4782
  if (value.files.some(
4838
4783
  (file) => !isSafeRelativePath(file) || file === MARKER_FILE
4839
4784
  ) || new Set(value.files).size !== value.files.length) {
@@ -4852,10 +4797,15 @@ function planSetupBlueprintRemovals({
4852
4797
  onError
4853
4798
  } = {}) {
4854
4799
  const root = resolve3(cwd);
4855
- const directories = [
4856
- root,
4857
- ...SETUP_BLUEPRINTS.map((blueprint) => resolve3(root, blueprint.id))
4858
- ];
4800
+ const directories = [root];
4801
+ try {
4802
+ directories.push(
4803
+ ...readdirSync(root, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => resolve3(root, entry.name))
4804
+ );
4805
+ } catch (error) {
4806
+ if (!onError) throw error;
4807
+ onError(root, error);
4808
+ }
4859
4809
  const seen = /* @__PURE__ */ new Set();
4860
4810
  const removals = [];
4861
4811
  for (const directory of directories) {
@@ -4866,12 +4816,10 @@ function planSetupBlueprintRemovals({
4866
4816
  if (!result) continue;
4867
4817
  const blueprint = SETUP_BLUEPRINTS.find(
4868
4818
  (candidate) => candidate.id === result.marker.id
4869
- );
4870
- if (!blueprint) {
4871
- throw new BlueprintScaffoldError(
4872
- `Cannot safely remove the blueprint in ${directory}: its marker is unsupported.`
4873
- );
4874
- }
4819
+ ) ?? {
4820
+ id: result.marker.id,
4821
+ name: result.marker.id
4822
+ };
4875
4823
  removals.push({
4876
4824
  blueprint,
4877
4825
  directory,
@@ -5077,7 +5025,7 @@ async function scaffoldSetupBlueprint({
5077
5025
  throw new BlueprintScaffoldError(
5078
5026
  `Blueprint destination ${directory} already contains the "${marker.id}" blueprint.`,
5079
5027
  {
5080
- hint: `Remove the directory to start over, or keep it and pick the "${marker.id}" blueprint in the setup wizard.`
5028
+ hint: "Remove the directory to start over; existing files are never overwritten."
5081
5029
  }
5082
5030
  );
5083
5031
  }
@@ -5308,7 +5256,7 @@ var SETUP_STEPS = [
5308
5256
  {
5309
5257
  id: "scaffold-blueprint",
5310
5258
  title: "Create the blueprint project",
5311
- detail: "Rocket Launch or Service worker",
5259
+ detail: "Rocket Launch example",
5312
5260
  component: "blueprint"
5313
5261
  },
5314
5262
  {
@@ -5799,6 +5747,7 @@ async function inspectSetupRemovalInventory({
5799
5747
  if (!globalThis.c8ctl) throw new Error("c8ctl runtime not initialised");
5800
5748
  var c8ctl2 = globalThis.c8ctl;
5801
5749
  var LOCAL_TENANT_ID = "<default>";
5750
+ var SETUP_BLUEPRINT = SETUP_BLUEPRINTS[0];
5802
5751
  function applyComponentFlags(selected, flags) {
5803
5752
  const next = new Set(selected);
5804
5753
  if (flags["no-modeler"]) next.delete("modeler");
@@ -5808,7 +5757,7 @@ function applyComponentFlags(selected, flags) {
5808
5757
  }
5809
5758
  function effectiveBlueprint(selected) {
5810
5759
  if (!selected.has("blueprint")) return void 0;
5811
- return SETUP_BLUEPRINTS[0].id;
5760
+ return SETUP_BLUEPRINT.id;
5812
5761
  }
5813
5762
  async function runPrerequisites(ctx) {
5814
5763
  const results = await checkPrerequisites();
@@ -6034,9 +5983,8 @@ async function runModelerInstall(ctx) {
6034
5983
  });
6035
5984
  }
6036
5985
  async function runBlueprintScaffold(ctx, run) {
6037
- const id = run.blueprintId ?? SETUP_BLUEPRINTS[0].id;
6038
5986
  const scaffolded = await scaffoldSetupBlueprint({
6039
- id,
5987
+ id: SETUP_BLUEPRINT.id,
6040
5988
  // The completion line is the step's takeaway — fresh or reused —
6041
5989
  // so it survives the success collapse; progress chatter does not.
6042
5990
  onProgress: (event) => ctx.logger.info(event.message, {
@@ -6047,14 +5995,11 @@ async function runBlueprintScaffold(ctx, run) {
6047
5995
  }
6048
5996
  async function runBlueprintDeploy(ctx, run) {
6049
5997
  const { logger } = ctx;
6050
- const blueprint = setupBlueprintById(
6051
- run.blueprintId ?? SETUP_BLUEPRINTS[0].id
6052
- );
6053
5998
  const directory = run.blueprintDir;
6054
5999
  if (!directory) {
6055
6000
  throw new Error("The blueprint project was not created.");
6056
6001
  }
6057
- const deployDir = join7(directory, blueprint.deployPath ?? ".");
6002
+ const deployDir = directory;
6058
6003
  const health = await checkLocalClusterHealth();
6059
6004
  if (!health.healthy) {
6060
6005
  throw new Error(
@@ -6090,17 +6035,19 @@ async function runBlueprintDeploy(ctx, run) {
6090
6035
  } finally {
6091
6036
  rmSync3(deployDataDir, { recursive: true, force: true });
6092
6037
  }
6093
- const processFile = join7(directory, blueprint.processFile);
6038
+ const processFile = join7(directory, SETUP_BLUEPRINT.processFile);
6094
6039
  const processId = extractProcessId(readFileSync6(processFile, "utf-8"));
6095
6040
  if (!processId) {
6096
- throw new Error(`Could not find a process id in ${blueprint.processFile}.`);
6041
+ throw new Error(
6042
+ `Could not find a process id in ${SETUP_BLUEPRINT.processFile}.`
6043
+ );
6097
6044
  }
6098
- logger.info(`Starting a ${blueprint.name} process instance...`);
6045
+ logger.info(`Starting a ${SETUP_BLUEPRINT.name} process instance...`);
6099
6046
  const created = await c8ctl2.createClient(DEFAULT_PROFILE).createProcessInstance({
6100
6047
  processDefinitionId: ProcessDefinitionId.assumeExists(processId),
6101
6048
  tenantId: TenantId.assumeExists(LOCAL_TENANT_ID),
6102
- ...blueprint.startVariables !== void 0 && {
6103
- variables: blueprint.startVariables
6049
+ ...SETUP_BLUEPRINT.startVariables !== void 0 && {
6050
+ variables: SETUP_BLUEPRINT.startVariables
6104
6051
  }
6105
6052
  });
6106
6053
  logger.info(`Process instance created: ${created.processInstanceKey}`);
@@ -6207,9 +6154,9 @@ function withBufferedOutput(ctx, buffer, aroundPassthrough) {
6207
6154
  });
6208
6155
  return Object.create(ctx, { logger: { value: bufferedLogger } });
6209
6156
  }
6210
- async function executePlan(ctx, selected, blueprintId, { color }) {
6157
+ async function executePlan(ctx, selected, { color }) {
6211
6158
  const { logger } = ctx;
6212
- const run = { blueprintId };
6159
+ const run = {};
6213
6160
  const succeeded = /* @__PURE__ */ new Set();
6214
6161
  let failures = 0;
6215
6162
  const width = Math.max(...SETUP_STEPS.map((step) => step.title.length));
@@ -6733,22 +6680,7 @@ async function runSetup(ctx, flags) {
6733
6680
  selected = defaultSelection();
6734
6681
  }
6735
6682
  selected = applyComponentFlags(selected, flags);
6736
- let blueprintId = effectiveBlueprint(selected);
6737
- if (selected.has("blueprint") && interactive) {
6738
- const choice = await ctx.prompt.select({
6739
- message: "Which starter blueprint should we install?",
6740
- options: SETUP_BLUEPRINTS.map((b) => ({
6741
- label: b.name,
6742
- description: `${b.description} \u2014 guide: ${b.guideUrl}`,
6743
- value: b.id
6744
- }))
6745
- });
6746
- if (choice.cancelled) {
6747
- logger.info("Cancelled \u2014 nothing was changed.");
6748
- return;
6749
- }
6750
- blueprintId = choice.value;
6751
- }
6683
+ const blueprintId = effectiveBlueprint(selected);
6752
6684
  if (jsonMode) {
6753
6685
  logger.json(setupPlanPayload(selected, { blueprint: blueprintId }));
6754
6686
  return;
@@ -6765,29 +6697,24 @@ async function runSetup(ctx, flags) {
6765
6697
  { essential: true }
6766
6698
  );
6767
6699
  }
6768
- const { failures, run } = await executePlan(ctx, selected, blueprintId, {
6769
- color
6770
- });
6700
+ const { failures, run } = await executePlan(ctx, selected, { color });
6771
6701
  const nextSteps = [];
6772
6702
  if (run.blueprintDir) {
6773
- const blueprint = setupBlueprintById(
6774
- run.blueprintId ?? SETUP_BLUEPRINTS[0].id
6775
- );
6776
6703
  if (run.processInstanceKey !== void 0) {
6777
6704
  nextSteps.push(
6778
- ...blueprint.nextSteps({
6705
+ ...SETUP_BLUEPRINT.nextSteps({
6779
6706
  projectDir: run.blueprintDir,
6780
6707
  processInstanceKey: run.processInstanceKey
6781
6708
  })
6782
6709
  );
6783
6710
  }
6784
6711
  nextSteps.push(`Project: ${run.blueprintDir}`);
6785
- nextSteps.push(`Guide: ${blueprint.guideUrl}`);
6712
+ nextSteps.push(`Guide: ${SETUP_BLUEPRINT.guideUrl}`);
6786
6713
  } else if (run.clusterStarted) {
6787
6714
  nextSteps.push("Run your first process:");
6788
6715
  nextSteps.push(' c8ctl use tenant "<default>"');
6789
6716
  nextSteps.push(" c8ctl run my-process.bpmn --profile local");
6790
- nextSteps.push('Or re-run "c8ctl setup" and pick a starter blueprint.');
6717
+ nextSteps.push('Or re-run "c8ctl setup" and include the example project.');
6791
6718
  }
6792
6719
  if (run.clusterStarted) {
6793
6720
  nextSteps.push("Operate: http://localhost:8080/operate (demo/demo)");
@@ -6838,15 +6765,15 @@ async function setupHandler(_args, flagsRecord, ctx) {
6838
6765
  process.exitCode = 1;
6839
6766
  }
6840
6767
  }
6841
- var SETUP_HELP_DESCRIPTION = `Guided first-run setup: install a local cluster, a starter blueprint project, and AI assistant tooling.
6768
+ var SETUP_HELP_DESCRIPTION = `Guided first-run setup: install a local cluster, the Rocket Launch example, and AI assistant tooling.
6842
6769
 
6843
- The wizard offers to start a local cluster (downloading Camunda 8 Run on first run), install Desktop Modeler, create a starter project from a blueprint, deploy and run it, and set up AI assistant tooling. Nothing is installed without your say.
6770
+ The wizard offers to start a local cluster (downloading Camunda 8 Run on first run), install Desktop Modeler, create the Rocket Launch example, deploy and run it, and set up AI assistant tooling. Nothing is installed without your say.
6844
6771
 
6845
6772
  Each step announces its title and ends in [SUCCESS], [ERROR] or [SKIPPED]; a step's own output is shown only when it fails, and a failed step does not stop the rest. The blueprint and the cluster MCP server need the local cluster \u2014 deselect the cluster and both options are disabled.
6846
6773
 
6847
6774
  A browser window opens when the local cluster reports healthy; the docs MCP server asks you to sign in in a browser on first use \u2014 announced up front.
6848
6775
 
6849
- A run without a selection (piped output, CI) installs nothing unless you pass --yes; --json prints the plan without executing. The starter blueprint is chosen in the wizard; a non-interactive --yes run uses Rocket Launch.
6776
+ A run without a selection (piped output, CI) installs nothing unless you pass --yes; --json prints the plan without executing. Setup always uses the Rocket Launch example.
6850
6777
 
6851
6778
  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.
6852
6779
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda8/cli",
3
- "version": "4.7.0-alpha.32",
3
+ "version": "4.7.0-alpha.34",
4
4
  "description": "Camunda 8 CLI - minimal-dependency CLI for Camunda 8 operations",
5
5
  "type": "module",
6
6
  "engines": {