@camunda8/cli 4.7.0-alpha.2 → 4.7.0-alpha.4

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.
Files changed (38) hide show
  1. package/README.md +1 -0
  2. package/dist/commands/deploy.d.ts.map +1 -1
  3. package/dist/commands/deploy.js +46 -7
  4. package/dist/commands/deploy.js.map +1 -1
  5. package/dist/commands/helpers/deploy-helpers.d.ts +83 -2
  6. package/dist/commands/helpers/deploy-helpers.d.ts.map +1 -1
  7. package/dist/commands/helpers/deploy-helpers.js +204 -65
  8. package/dist/commands/helpers/deploy-helpers.js.map +1 -1
  9. package/dist/commands/watch.d.ts.map +1 -1
  10. package/dist/commands/watch.js +301 -16
  11. package/dist/commands/watch.js.map +1 -1
  12. package/dist/default-plugins/cluster/README.md +3 -1
  13. package/dist/default-plugins/cluster/c8ctl-plugin.js +37 -1
  14. package/dist/utils/command-local/setup-detectors.d.ts +51 -0
  15. package/dist/utils/command-local/setup-detectors.d.ts.map +1 -0
  16. package/dist/utils/command-local/setup-detectors.js +115 -0
  17. package/dist/utils/command-local/setup-detectors.js.map +1 -0
  18. package/dist/utils/command-local/setup-prerequisites.d.ts +67 -0
  19. package/dist/utils/command-local/setup-prerequisites.d.ts.map +1 -0
  20. package/dist/utils/command-local/setup-prerequisites.js +238 -0
  21. package/dist/utils/command-local/setup-prerequisites.js.map +1 -0
  22. package/dist/utils/index.d.ts +3 -0
  23. package/dist/utils/index.d.ts.map +1 -1
  24. package/dist/utils/index.js +3 -0
  25. package/dist/utils/index.js.map +1 -1
  26. package/dist/utils/shared/camunda-json.d.ts +8 -0
  27. package/dist/utils/shared/camunda-json.d.ts.map +1 -1
  28. package/dist/utils/shared/camunda-json.js +3 -0
  29. package/dist/utils/shared/camunda-json.js.map +1 -1
  30. package/dist/utils/shared/deploy-resource-selection.d.ts +173 -0
  31. package/dist/utils/shared/deploy-resource-selection.d.ts.map +1 -0
  32. package/dist/utils/shared/deploy-resource-selection.js +476 -0
  33. package/dist/utils/shared/deploy-resource-selection.js.map +1 -0
  34. package/dist/utils/shared/ignore.d.ts +26 -0
  35. package/dist/utils/shared/ignore.d.ts.map +1 -1
  36. package/dist/utils/shared/ignore.js +6 -2
  37. package/dist/utils/shared/ignore.js.map +1 -1
  38. package/package.json +1 -1
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Done-checks for `c8ctl setup`: whether Camunda 8 Run is installed and
3
+ * whether the local cluster is healthy. Setup re-checks these on every run
4
+ * instead of trusting a record of earlier runs.
5
+ *
6
+ * Built-in code cannot import the cluster plugin, so the install checks
7
+ * follow its rules (cache location, install layout, binary name). Tests
8
+ * compare them with the plugin's own functions.
9
+ */
10
+ import { existsSync, readdirSync } from "node:fs";
11
+ import { homedir } from "node:os";
12
+ import { join } from "node:path";
13
+ // ── Camunda 8 Run installation ─────────────────────────────────────
14
+ /** Where the cluster plugin keeps Camunda 8 Run installs. */
15
+ export function c8runCacheDir({ env = process.env, platform = process.platform, home = homedir(), } = {}) {
16
+ if (env.C8RUN_CACHE_DIR)
17
+ return env.C8RUN_CACHE_DIR;
18
+ switch (platform) {
19
+ case "darwin":
20
+ return join(home, "Library", "Caches", "c8run");
21
+ case "win32":
22
+ return join(env.LOCALAPPDATA || join(home, "AppData", "Local"), "c8run", "cache");
23
+ default:
24
+ return join(env.XDG_CACHE_HOME || join(home, ".cache"), "c8run");
25
+ }
26
+ }
27
+ const binaryName = (platform) => platform === "win32" ? "c8run.exe" : "c8run";
28
+ /**
29
+ * Whether `version`'s Camunda 8 Run binary is present: in a
30
+ * `c8run-<version>*` subdirectory of `c8run-<version>`, or directly in it.
31
+ */
32
+ export function isCamunda8RunInstalled({ version, cacheDir = c8runCacheDir(), platform = process.platform, }) {
33
+ const installDir = join(cacheDir, `c8run-${version}`);
34
+ if (!existsSync(installDir))
35
+ return false;
36
+ const binary = binaryName(platform);
37
+ const nested = readdirSync(installDir, { withFileTypes: true }).some((entry) => entry.isDirectory() &&
38
+ entry.name.startsWith(`c8run-${version}`) &&
39
+ existsSync(join(installDir, entry.name, binary)));
40
+ return nested || existsSync(join(installDir, binary));
41
+ }
42
+ /** Installed versions whose binary is present, in version order. */
43
+ export function installedCamunda8RunVersions({ cacheDir = c8runCacheDir(), platform = process.platform, } = {}) {
44
+ if (!existsSync(cacheDir))
45
+ return [];
46
+ return readdirSync(cacheDir, { withFileTypes: true })
47
+ .filter((entry) => entry.isDirectory() && entry.name.startsWith("c8run-"))
48
+ .map((entry) => entry.name.slice("c8run-".length))
49
+ .filter((version) => isCamunda8RunInstalled({ version, cacheDir, platform }))
50
+ .sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
51
+ }
52
+ // ── Local cluster health ───────────────────────────────────────────
53
+ /** The endpoint the cluster plugin polls to decide a started cluster is ready. */
54
+ export const LOCAL_CLUSTER_HEALTH_URL = "http://localhost:9600/actuator/health";
55
+ const DEFAULT_HEALTH_TIMEOUT_MS = 3_000;
56
+ function causeCode(error) {
57
+ for (let current = error, depth = 0; current && depth < 5; depth++) {
58
+ if (typeof current !== "object")
59
+ return undefined;
60
+ if ("code" in current && typeof current.code === "string") {
61
+ return current.code;
62
+ }
63
+ current = "cause" in current ? current.cause : undefined;
64
+ }
65
+ return undefined;
66
+ }
67
+ /**
68
+ * Whether a local cluster is running and healthy: its health endpoint
69
+ * reports `UP`. One request, no retries.
70
+ */
71
+ export async function checkLocalClusterHealth({ fetch = globalThis.fetch, timeoutMs = DEFAULT_HEALTH_TIMEOUT_MS, } = {}) {
72
+ // A referenced timer, unlike AbortSignal.timeout(), so the timeout fires
73
+ // even when nothing else keeps the event loop alive.
74
+ const controller = new AbortController();
75
+ let timedOut = false;
76
+ const timer = setTimeout(() => {
77
+ timedOut = true;
78
+ controller.abort();
79
+ }, timeoutMs);
80
+ try {
81
+ const response = await fetch(LOCAL_CLUSTER_HEALTH_URL, {
82
+ signal: controller.signal,
83
+ });
84
+ if (!response.ok) {
85
+ return { healthy: false, detail: `HTTP ${response.status}` };
86
+ }
87
+ let body;
88
+ try {
89
+ body = await response.json();
90
+ }
91
+ catch (error) {
92
+ // A body that stalls past the timeout is a timeout, not bad data.
93
+ if (timedOut)
94
+ throw error;
95
+ return { healthy: false, detail: "unexpected response" };
96
+ }
97
+ const status = body && typeof body === "object" && "status" in body
98
+ ? String(body.status)
99
+ : "unknown";
100
+ return { healthy: status === "UP", detail: `status ${status}` };
101
+ }
102
+ catch (error) {
103
+ const reason = timedOut
104
+ ? `timed out after ${timeoutMs / 1000}s`
105
+ : (causeCode(error) ?? "connection failed");
106
+ return { healthy: false, detail: `not reachable (${reason})` };
107
+ }
108
+ finally {
109
+ clearTimeout(timer);
110
+ // Release a response whose body was not read (e.g. a 503), so an open
111
+ // connection cannot keep the process alive.
112
+ controller.abort();
113
+ }
114
+ }
115
+ //# sourceMappingURL=setup-detectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-detectors.js","sourceRoot":"","sources":["../../../src/utils/command-local/setup-detectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,sEAAsE;AAEtE,6DAA6D;AAC7D,MAAM,UAAU,aAAa,CAAC,EAC7B,GAAG,GAAG,OAAO,CAAC,GAAG,EACjB,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAC3B,IAAI,GAAG,OAAO,EAAE,MAKb,EAAE;IACL,IAAI,GAAG,CAAC,eAAe;QAAE,OAAO,GAAG,CAAC,eAAe,CAAC;IACpD,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,QAAQ;YACZ,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjD,KAAK,OAAO;YACX,OAAO,IAAI,CACV,GAAG,CAAC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E,OAAO,EAAE,MAAM,KAAK,IAAI,EAAE,MAAM,EAAE,UAAU,MAAM,EAAE,EAAE,CAAC;IACjE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,QAAQ;YACtB,CAAC,CAAC,mBAAmB,SAAS,GAAG,IAAI,GAAG;YACxC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,mBAAmB,CAAC,CAAC;QAC7C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,MAAM,GAAG,EAAE,CAAC;IAChE,CAAC;YAAS,CAAC;QACV,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,sEAAsE;QACtE,4CAA4C;QAC5C,UAAU,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;AACF,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Prerequisite checks for `c8ctl setup`: Node.js version, operating
3
+ * system and architecture, and network access to the Camunda 8 Run
4
+ * download host.
5
+ *
6
+ * Inputs (versions, platform, fetch, environment) are parameters with
7
+ * the real runtime as the default, so every outcome is testable.
8
+ */
9
+ export type PrerequisiteId = "node" | "platform" | "network";
10
+ export interface PrerequisiteResult {
11
+ readonly id: PrerequisiteId;
12
+ readonly title: string;
13
+ readonly ok: boolean;
14
+ /** What was found, e.g. "Node.js 22.17.1 is installed; c8ctl needs >=22.18.0." */
15
+ readonly detail: string;
16
+ /** How to fix a failed check. */
17
+ readonly hint?: string;
18
+ }
19
+ /** The `fetch` subset the network check uses. */
20
+ export type PrerequisiteFetch = (url: string, init: {
21
+ method: string;
22
+ redirect: "manual";
23
+ signal: AbortSignal;
24
+ }) => Promise<unknown>;
25
+ type Env = Readonly<Record<string, string | undefined>>;
26
+ /**
27
+ * Pages for setting Camunda up by hand, for anyone who cannot meet a
28
+ * prerequisite. Unversioned docs.camunda.io URLs resolve to the current
29
+ * release.
30
+ */
31
+ export declare const MANUAL_SETUP_LINKS: readonly {
32
+ readonly label: string;
33
+ readonly url: string;
34
+ }[];
35
+ /** The Node.js range from c8ctl's `engines.node`, the one npm enforces. */
36
+ export declare const REQUIRED_NODE_RANGE: string | undefined;
37
+ export declare function checkNodeVersion({ version, range, }?: {
38
+ version?: string;
39
+ range?: string;
40
+ }): PrerequisiteResult;
41
+ export declare function checkPlatform({ platform, arch, }?: {
42
+ platform?: string;
43
+ arch?: string;
44
+ }): PrerequisiteResult;
45
+ /**
46
+ * Check that the Camunda 8 Run download host answers. Any HTTP response,
47
+ * including a redirect, counts as reachable; a connection failure, a
48
+ * timeout, or a download URL that cannot work fails.
49
+ */
50
+ export declare function checkNetwork({ fetch, env, timeoutMs, }?: {
51
+ fetch?: PrerequisiteFetch;
52
+ env?: Env;
53
+ timeoutMs?: number;
54
+ }): Promise<PrerequisiteResult>;
55
+ export declare function checkPrerequisites(options?: {
56
+ version?: string;
57
+ range?: string;
58
+ platform?: string;
59
+ arch?: string;
60
+ fetch?: PrerequisiteFetch;
61
+ env?: Env;
62
+ timeoutMs?: number;
63
+ }): Promise<PrerequisiteResult[]>;
64
+ /** Explain the failed checks and point at the manual setup instead. */
65
+ export declare function formatPrerequisiteFailures(results: readonly PrerequisiteResult[]): string;
66
+ export {};
67
+ //# sourceMappingURL=setup-prerequisites.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-prerequisites.d.ts","sourceRoot":"","sources":["../../../src/utils/command-local/setup-prerequisites.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,Q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,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,SAAS,CAAC,EAAE,MAAM,CAAC;CACd,GACJ,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAM/B;AAED,uEAAuE;AACvE,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACpC,MAAM,CAaR"}
@@ -0,0 +1,238 @@
1
+ /**
2
+ * Prerequisite checks for `c8ctl setup`: Node.js version, operating
3
+ * system and architecture, and network access to the Camunda 8 Run
4
+ * download host.
5
+ *
6
+ * Inputs (versions, platform, fetch, environment) are parameters with
7
+ * the real runtime as the default, so every outcome is testable.
8
+ */
9
+ import { readFileSync } from "node:fs";
10
+ import { join } from "node:path";
11
+ import semver from "semver";
12
+ /**
13
+ * Pages for setting Camunda up by hand, for anyone who cannot meet a
14
+ * prerequisite. Unversioned docs.camunda.io URLs resolve to the current
15
+ * release.
16
+ */
17
+ export const MANUAL_SETUP_LINKS = [
18
+ {
19
+ label: "Run your first process without c8ctl",
20
+ url: "https://docs.camunda.io/docs/guides/getting-started-hello-world/",
21
+ },
22
+ {
23
+ label: "Install and start Camunda 8 Run",
24
+ url: "https://docs.camunda.io/docs/self-managed/quickstart/developer-quickstart/c8run/install-start/",
25
+ },
26
+ {
27
+ label: "Install Desktop Modeler",
28
+ url: "https://docs.camunda.io/docs/components/modeler/desktop-modeler/install-the-modeler/",
29
+ },
30
+ ];
31
+ // ── Node.js ────────────────────────────────────────────────────────
32
+ function readRequiredNodeRange() {
33
+ try {
34
+ // src/utils/command-local/ and dist/utils/command-local/ are both
35
+ // three levels below the package root.
36
+ const pkg = JSON.parse(readFileSync(join(import.meta.dirname, "..", "..", "..", "package.json"), "utf-8"));
37
+ const engines = pkg && typeof pkg === "object" && "engines" in pkg
38
+ ? pkg.engines
39
+ : undefined;
40
+ const node = engines && typeof engines === "object" && "node" in engines
41
+ ? engines.node
42
+ : undefined;
43
+ return typeof node === "string" ? node : undefined;
44
+ }
45
+ catch {
46
+ return undefined;
47
+ }
48
+ }
49
+ /** The Node.js range from c8ctl's `engines.node`, the one npm enforces. */
50
+ export const REQUIRED_NODE_RANGE = readRequiredNodeRange();
51
+ export function checkNodeVersion({ version = process.versions.node, range = REQUIRED_NODE_RANGE, } = {}) {
52
+ const title = "Node.js version";
53
+ if (!range) {
54
+ return { id: "node", title, ok: true, detail: `Node.js ${version}.` };
55
+ }
56
+ const ok = semver.satisfies(version, range, { includePrerelease: true });
57
+ return ok
58
+ ? { id: "node", title, ok, detail: `Node.js ${version}.` }
59
+ : {
60
+ id: "node",
61
+ title,
62
+ ok,
63
+ detail: `Node.js ${version} is installed; c8ctl needs ${range}.`,
64
+ hint: "Install a supported Node.js release from https://nodejs.org/en/download, then run c8ctl setup again.",
65
+ };
66
+ }
67
+ // ── Platform ───────────────────────────────────────────────────────
68
+ /**
69
+ * Platform and architecture pairs Camunda 8 Run is published for: exactly
70
+ * the darwin-aarch64, darwin-x86_64, linux-x86_64 and windows-x86_64
71
+ * builds on the Camunda Download Center. Other pairs, including Linux and
72
+ * Windows on arm64, have no build to download.
73
+ */
74
+ const SUPPORTED_ARCHS_BY_PLATFORM = {
75
+ darwin: ["x64", "arm64"],
76
+ linux: ["x64"],
77
+ win32: ["x64"],
78
+ };
79
+ export function checkPlatform({ platform = process.platform, arch = process.arch, } = {}) {
80
+ const title = "Operating system";
81
+ const ok = Object.hasOwn(SUPPORTED_ARCHS_BY_PLATFORM, platform) &&
82
+ SUPPORTED_ARCHS_BY_PLATFORM[platform].includes(arch);
83
+ return ok
84
+ ? { id: "platform", title, ok, detail: `${platform} ${arch}.` }
85
+ : {
86
+ id: "platform",
87
+ title,
88
+ ok,
89
+ detail: `Camunda 8 Run is not available for ${platform} ${arch}.`,
90
+ hint: "Camunda 8 Run is available for macOS (x64, arm64), Linux (x64) and Windows (x64).",
91
+ };
92
+ }
93
+ // ── Network ────────────────────────────────────────────────────────
94
+ const DEFAULT_DOWNLOAD_URL = "https://downloads.camunda.cloud/release/camunda/c8run/";
95
+ const DEFAULT_NETWORK_TIMEOUT_MS = 10_000;
96
+ /** The download base URL, honouring the same mirror override as the cluster plugin. */
97
+ function downloadBaseUrl(env) {
98
+ return (env.C8CTL_C8RUN_DOWNLOAD_URL || DEFAULT_DOWNLOAD_URL).replace(/\/*$/, "/");
99
+ }
100
+ /**
101
+ * A URL safe to print, redacted like the cluster plugin's download URLs:
102
+ * credentials become `***`, and a query string or fragment `?<redacted>`.
103
+ */
104
+ function displayUrl(url) {
105
+ try {
106
+ const parsed = new URL(url);
107
+ if (parsed.username || parsed.password) {
108
+ parsed.username = "***";
109
+ parsed.password = "";
110
+ }
111
+ const query = parsed.search || parsed.hash ? "?<redacted>" : "";
112
+ parsed.search = "";
113
+ parsed.hash = "";
114
+ return `${parsed.toString()}${query}`;
115
+ }
116
+ catch {
117
+ return "(invalid URL)";
118
+ }
119
+ }
120
+ /** Why a download URL cannot work, as the cluster plugin reports it, or undefined. */
121
+ function downloadUrlProblem(url) {
122
+ let parsed;
123
+ try {
124
+ parsed = new URL(url);
125
+ }
126
+ catch {
127
+ return "not a valid URL";
128
+ }
129
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
130
+ return `unsupported protocol ${parsed.protocol} (use http or https)`;
131
+ }
132
+ if (parsed.username || parsed.password) {
133
+ return "the URL contains credentials, which fetch() does not send";
134
+ }
135
+ return undefined;
136
+ }
137
+ /** The first error code in an error's cause chain, e.g. ENOTFOUND. */
138
+ function causeCode(error) {
139
+ for (let current = error, depth = 0; current && depth < 5; depth++) {
140
+ if (typeof current !== "object")
141
+ return undefined;
142
+ if ("code" in current && typeof current.code === "string") {
143
+ return current.code;
144
+ }
145
+ current = "cause" in current ? current.cause : undefined;
146
+ }
147
+ return undefined;
148
+ }
149
+ function networkHint(env) {
150
+ if (env.C8CTL_C8RUN_DOWNLOAD_URL) {
151
+ return ("C8CTL_C8RUN_DOWNLOAD_URL points the download at a mirror. Make sure that " +
152
+ "server is reachable, or unset it to use the Camunda Download Center.");
153
+ }
154
+ if ((env.HTTPS_PROXY || env.https_proxy) && env.NODE_USE_ENV_PROXY !== "1") {
155
+ return ("HTTPS_PROXY is set, but Node.js only uses it when NODE_USE_ENV_PROXY=1 is " +
156
+ "set as well (Node.js 22.21+ or 24.5+). Set NODE_USE_ENV_PROXY=1 and try again.");
157
+ }
158
+ return ("Check your network connection. Behind a proxy? Set HTTPS_PROXY together with " +
159
+ "NODE_USE_ENV_PROXY=1 (Node.js 22.21+ or 24.5+).");
160
+ }
161
+ /**
162
+ * Check that the Camunda 8 Run download host answers. Any HTTP response,
163
+ * including a redirect, counts as reachable; a connection failure, a
164
+ * timeout, or a download URL that cannot work fails.
165
+ */
166
+ export async function checkNetwork({ fetch = globalThis.fetch, env = process.env, timeoutMs = DEFAULT_NETWORK_TIMEOUT_MS, } = {}) {
167
+ const title = "Network access";
168
+ const url = downloadBaseUrl(env);
169
+ const shown = displayUrl(url);
170
+ const problem = downloadUrlProblem(url);
171
+ if (problem) {
172
+ return {
173
+ id: "network",
174
+ title,
175
+ ok: false,
176
+ detail: `Cannot use ${shown}: ${problem}.`,
177
+ hint: networkHint(env),
178
+ };
179
+ }
180
+ // A referenced timer rather than AbortSignal.timeout(), whose timer is
181
+ // unreferenced: the timeout must fire even when nothing else keeps the
182
+ // event loop alive, or a stalled request could end the process early.
183
+ const controller = new AbortController();
184
+ let timedOut = false;
185
+ const timer = setTimeout(() => {
186
+ timedOut = true;
187
+ controller.abort();
188
+ }, timeoutMs);
189
+ try {
190
+ // A redirect is an answer from the host, so it is not followed.
191
+ await fetch(url, {
192
+ method: "HEAD",
193
+ redirect: "manual",
194
+ signal: controller.signal,
195
+ });
196
+ return { id: "network", title, ok: true, detail: `${shown} is reachable.` };
197
+ }
198
+ catch (error) {
199
+ // Never the error's message: it can repeat the URL, credentials included.
200
+ const reason = timedOut
201
+ ? `timed out after ${timeoutMs / 1000}s`
202
+ : (causeCode(error) ?? "connection failed");
203
+ return {
204
+ id: "network",
205
+ title,
206
+ ok: false,
207
+ detail: `Could not reach ${shown} (${reason}).`,
208
+ hint: networkHint(env),
209
+ };
210
+ }
211
+ finally {
212
+ clearTimeout(timer);
213
+ }
214
+ }
215
+ // ── All checks ─────────────────────────────────────────────────────
216
+ export async function checkPrerequisites(options = {}) {
217
+ return [
218
+ checkNodeVersion(options),
219
+ checkPlatform(options),
220
+ await checkNetwork(options),
221
+ ];
222
+ }
223
+ /** Explain the failed checks and point at the manual setup instead. */
224
+ export function formatPrerequisiteFailures(results) {
225
+ const failed = results.filter((result) => !result.ok);
226
+ return [
227
+ "c8ctl setup cannot continue:",
228
+ "",
229
+ ...failed.flatMap((result) => [
230
+ ` ✗ ${result.title}: ${result.detail}`,
231
+ ...(result.hint ? [` ${result.hint}`] : []),
232
+ ]),
233
+ "",
234
+ "To set up Camunda by hand instead:",
235
+ ...MANUAL_SETUP_LINKS.map((link) => ` ${link.label}: ${link.url}`),
236
+ ].join("\n");
237
+ }
238
+ //# sourceMappingURL=setup-prerequisites.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-prerequisites.js","sourceRoot":"","sources":["../../../src/utils/command-local/setup-prerequisites.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAsB5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAGzB;IACL;QACC,KAAK,EAAE,sCAAsC;QAC7C,GAAG,EAAE,kEAAkE;KACvE;IACD;QACC,KAAK,EAAE,iCAAiC;QACxC,GAAG,EAAE,gGAAgG;KACrG;IACD;QACC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AmB,KAAK,KAAK,MAAM,IAAI;YAC/C,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC;SACtB,CAAC;IACH,CAAC;YAAS,CAAC;QACV,YAAY,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACF,CAAC;AAED,sEAAsE;AAEtE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,UAQI,EAAE;IAEN,OAAO;QACN,gBAAgB,CAAC,OAAO,CAAC;QACzB,aAAa,CAAC,OAAO,CAAC;QACtB,MAAM,YAAY,CAAC,OAAO,CAAC;KAC3B,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,0BAA0B,CACzC,OAAsC;IAEtC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtD,OAAO;QACN,8BAA8B;QAC9B,EAAE;QACF,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YAC7B,OAAO,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,EAAE;YACvC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9C,CAAC;QACF,EAAE;QACF,oCAAoC;QACpC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;KACnE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC"}
@@ -3,9 +3,12 @@ export * from "./command-local/mcp-proxy-helpers.ts";
3
3
  export * from "./command-local/open-helpers.ts";
4
4
  export * from "./command-local/process-instance-helpers.ts";
5
5
  export * from "./command-local/search-helpers.ts";
6
+ export * from "./command-local/setup-detectors.ts";
7
+ export * from "./command-local/setup-prerequisites.ts";
6
8
  export * from "./command-local/watch-constants.ts";
7
9
  export * from "./shared/camunda-json.ts";
8
10
  export * from "./shared/date-filter.ts";
11
+ export * from "./shared/deploy-resource-selection.ts";
9
12
  export * from "./shared/ignore.ts";
10
13
  export * from "./shared/npm-exec.ts";
11
14
  export * from "./shared/resource-extensions.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAMA,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAMA,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
@@ -9,9 +9,12 @@ export * from "./command-local/mcp-proxy-helpers.js";
9
9
  export * from "./command-local/open-helpers.js";
10
10
  export * from "./command-local/process-instance-helpers.js";
11
11
  export * from "./command-local/search-helpers.js";
12
+ export * from "./command-local/setup-detectors.js";
13
+ export * from "./command-local/setup-prerequisites.js";
12
14
  export * from "./command-local/watch-constants.js";
13
15
  export * from "./shared/camunda-json.js";
14
16
  export * from "./shared/date-filter.js";
17
+ export * from "./shared/deploy-resource-selection.js";
15
18
  export * from "./shared/ignore.js";
16
19
  export * from "./shared/npm-exec.js";
17
20
  export * from "./shared/resource-extensions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,wCAAwC;AACxC,+DAA+D;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,wCAAwC;AACxC,+DAA+D;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
@@ -32,6 +32,14 @@ export interface CamundaProject {
32
32
  /** ID of the linked project in Camunda Hub. */
33
33
  projectId?: string;
34
34
  };
35
+ /**
36
+ * Raw value of the optional `deployResources` field, kept verbatim
37
+ * when the key is present (even when it is `null` or wrong-typed) so
38
+ * the integration that consumes it can validate strictly and report
39
+ * a precise error. Absent key → property absent. Validate with
40
+ * `parseDeployResources` from `deploy-resource-selection.ts`.
41
+ */
42
+ deployResources?: unknown;
35
43
  }
36
44
  /**
37
45
  * Decode descriptor bytes, tolerating the BOMs that Windows tooling
@@ -1 +1 @@
1
- {"version":3,"file":"camunda-json.d.ts","sourceRoot":"","sources":["../../../src/utils/shared/camunda-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,uCAAuC;IACvC,GAAG,CAAC,EAAE;QACL,+CAA+C;QAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAA6B,GACnC,cAAc,CAgChB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CASzE"}
1
+ {"version":3,"file":"camunda-json.d.ts","sourceRoot":"","sources":["../../../src/utils/shared/camunda-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,uCAAuC;IACvC,GAAG,CAAC,EAAE;QACL,+CAA+C;QAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAA6B,GACnC,cAAc,CAoChB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CASzE"}
@@ -67,6 +67,9 @@ export function parseCamundaJson(content, source = CAMUNDA_PROJECT_FILE) {
67
67
  project.hub =
68
68
  typeof hub.projectId === "string" ? { projectId: hub.projectId } : {};
69
69
  }
70
+ if (Object.hasOwn(parsed, "deployResources")) {
71
+ project.deployResources = parsed.deployResources;
72
+ }
70
73
  return project;
71
74
  }
72
75
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"camunda-json.js","sourceRoot":"","sources":["../../../src/utils/shared/camunda-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,qDAAqD;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAEnD,iEAAi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