@camunda8/cli 4.7.0-alpha.1 → 4.7.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTEXT.md +11 -0
- package/PLUGIN-HELP.md +5 -1
- package/README.md +13 -2
- package/dist/command-dispatch.d.ts.map +1 -1
- package/dist/command-dispatch.js +9 -0
- package/dist/command-dispatch.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +48 -9
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/helpers/deploy-helpers.d.ts +83 -2
- package/dist/commands/helpers/deploy-helpers.d.ts.map +1 -1
- package/dist/commands/helpers/deploy-helpers.js +204 -65
- package/dist/commands/helpers/deploy-helpers.js.map +1 -1
- package/dist/commands/identity-authorizations.js +1 -1
- package/dist/commands/identity-authorizations.js.map +1 -1
- package/dist/commands/identity-groups.js +1 -1
- package/dist/commands/identity-groups.js.map +1 -1
- package/dist/commands/identity-mapping-rules.js +1 -1
- package/dist/commands/identity-mapping-rules.js.map +1 -1
- package/dist/commands/identity-roles.js +1 -1
- package/dist/commands/identity-roles.js.map +1 -1
- package/dist/commands/identity-tenants.js +1 -1
- package/dist/commands/identity-tenants.js.map +1 -1
- package/dist/commands/identity-users.js +1 -1
- package/dist/commands/identity-users.js.map +1 -1
- package/dist/commands/mcp-proxy.d.ts.map +1 -1
- package/dist/commands/mcp-proxy.js +13 -8
- package/dist/commands/mcp-proxy.js.map +1 -1
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +102 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/modeler.d.ts +2 -0
- package/dist/commands/modeler.d.ts.map +1 -0
- package/dist/commands/modeler.js +589 -0
- package/dist/commands/modeler.js.map +1 -0
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +2 -1
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +45 -35
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/profiles.d.ts.map +1 -1
- package/dist/commands/profiles.js +27 -13
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +11 -9
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/skills.d.ts +2 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +38 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +309 -16
- package/dist/commands/watch.js.map +1 -1
- package/dist/core/client.d.ts +13 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +48 -21
- package/dist/core/client.js.map +1 -1
- package/dist/core/config.d.ts +34 -3
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +94 -10
- package/dist/core/config.js.map +1 -1
- package/dist/core/env-address.d.ts +22 -0
- package/dist/core/env-address.d.ts.map +1 -0
- package/dist/core/env-address.js +30 -0
- package/dist/core/env-address.js.map +1 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +4 -2
- package/dist/core/errors.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/logger.d.ts +12 -2
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +21 -3
- package/dist/core/logger.js.map +1 -1
- package/dist/core/runtime.d.ts +5 -0
- package/dist/core/runtime.d.ts.map +1 -1
- package/dist/core/runtime.js +7 -0
- package/dist/core/runtime.js.map +1 -1
- package/dist/core/update-check.d.ts +2 -1
- package/dist/core/update-check.d.ts.map +1 -1
- package/dist/core/update-check.js +3 -2
- package/dist/core/update-check.js.map +1 -1
- package/dist/default-plugins/bpmn/c8ctl-plugin.js +8 -11
- package/dist/default-plugins/cluster/README.md +3 -1
- package/dist/default-plugins/cluster/c8ctl-plugin.js +46 -10
- package/dist/default-plugins/element-template/c8ctl-plugin.js +7 -0
- package/dist/default-plugins/feel/c8ctl-plugin.js +6 -2
- package/dist/framework/argv-parser.d.ts.map +1 -1
- package/dist/framework/argv-parser.js +9 -0
- package/dist/framework/argv-parser.js.map +1 -1
- package/dist/framework/command-framework.d.ts +2 -0
- package/dist/framework/command-framework.d.ts.map +1 -1
- package/dist/framework/command-framework.js +3 -2
- package/dist/framework/command-framework.js.map +1 -1
- package/dist/framework/command-registry.d.ts +96 -0
- package/dist/framework/command-registry.d.ts.map +1 -1
- package/dist/framework/command-registry.js +165 -0
- package/dist/framework/command-registry.js.map +1 -1
- package/dist/framework/plugins/plugin-loader.d.ts +5 -0
- package/dist/framework/plugins/plugin-loader.d.ts.map +1 -1
- package/dist/framework/plugins/plugin-loader.js.map +1 -1
- package/dist/framework/ui/completion.d.ts.map +1 -1
- package/dist/framework/ui/completion.js +2 -2
- package/dist/framework/ui/completion.js.map +1 -1
- package/dist/framework/ui/help.d.ts.map +1 -1
- package/dist/framework/ui/help.js +37 -4
- package/dist/framework/ui/help.js.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/utils/command-local/mcp-install-helpers.d.ts +30 -0
- package/dist/utils/command-local/mcp-install-helpers.d.ts.map +1 -0
- package/dist/utils/command-local/mcp-install-helpers.js +291 -0
- package/dist/utils/command-local/mcp-install-helpers.js.map +1 -0
- package/dist/utils/command-local/modeler-helpers.d.ts +15 -0
- package/dist/utils/command-local/modeler-helpers.d.ts.map +1 -0
- package/dist/utils/command-local/modeler-helpers.js +67 -0
- package/dist/utils/command-local/modeler-helpers.js.map +1 -0
- package/dist/utils/command-local/open-helpers.js +2 -2
- package/dist/utils/command-local/open-helpers.js.map +1 -1
- package/dist/utils/command-local/search-helpers.d.ts.map +1 -1
- package/dist/utils/command-local/search-helpers.js +4 -2
- package/dist/utils/command-local/search-helpers.js.map +1 -1
- package/dist/utils/command-local/setup-detectors.d.ts +51 -0
- package/dist/utils/command-local/setup-detectors.d.ts.map +1 -0
- package/dist/utils/command-local/setup-detectors.js +115 -0
- package/dist/utils/command-local/setup-detectors.js.map +1 -0
- package/dist/utils/command-local/setup-prerequisites.d.ts +67 -0
- package/dist/utils/command-local/setup-prerequisites.d.ts.map +1 -0
- package/dist/utils/command-local/setup-prerequisites.js +238 -0
- package/dist/utils/command-local/setup-prerequisites.js.map +1 -0
- package/dist/utils/command-local/skills-install-helpers.d.ts +24 -0
- package/dist/utils/command-local/skills-install-helpers.d.ts.map +1 -0
- package/dist/utils/command-local/skills-install-helpers.js +106 -0
- package/dist/utils/command-local/skills-install-helpers.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/shared/camunda-json.d.ts +24 -3
- package/dist/utils/shared/camunda-json.d.ts.map +1 -1
- package/dist/utils/shared/camunda-json.js +23 -5
- package/dist/utils/shared/camunda-json.js.map +1 -1
- package/dist/utils/shared/deploy-resource-selection.d.ts +165 -0
- package/dist/utils/shared/deploy-resource-selection.d.ts.map +1 -0
- package/dist/utils/shared/deploy-resource-selection.js +466 -0
- package/dist/utils/shared/deploy-resource-selection.js.map +1 -0
- package/dist/utils/shared/ignore.d.ts +26 -0
- package/dist/utils/shared/ignore.d.ts.map +1 -1
- package/dist/utils/shared/ignore.js +6 -2
- package/dist/utils/shared/ignore.js.map +1 -1
- package/dist/utils/shared/validation.js +2 -2
- package/dist/utils/shared/validation.js.map +1 -1
- package/package.json +3 -2
|
@@ -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,KAAK,EAAE,yBAAyB;QAChC,GAAG,EAAE,sFAAsF;KAC3F;CACD,CAAC;AAEF,sEAAsE;AAEtE,SAA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AC;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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type Env = Readonly<Record<string, string | undefined>>;
|
|
2
|
+
export declare const CAMUNDA_SKILLS_REPOSITORY = "camunda/skills";
|
|
3
|
+
export declare function normalizeSkillHarness(value: string): string;
|
|
4
|
+
export declare function buildSkillInstallArgs(harness: string): string[];
|
|
5
|
+
export declare function executableIsOnPath({ name, env, platform, }: {
|
|
6
|
+
name: string;
|
|
7
|
+
env: Env;
|
|
8
|
+
platform: string;
|
|
9
|
+
}): boolean;
|
|
10
|
+
export declare function detectInstalledHarnesses({ env, home, platform, }?: {
|
|
11
|
+
env?: Env;
|
|
12
|
+
home?: string;
|
|
13
|
+
platform?: string;
|
|
14
|
+
}): string[];
|
|
15
|
+
export interface SkillInstallRunResult {
|
|
16
|
+
readonly status: number | null;
|
|
17
|
+
readonly stdout: string;
|
|
18
|
+
readonly stderr: string;
|
|
19
|
+
readonly error?: Error;
|
|
20
|
+
}
|
|
21
|
+
export type SkillInstallRunner = (command: string, args: string[]) => SkillInstallRunResult;
|
|
22
|
+
export declare function runSkillInstall(harness: string, runner?: SkillInstallRunner): void;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=skills-install-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-install-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/command-local/skills-install-helpers.ts"],"names":[],"mappings":"AAKA,KAAK,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAiBxD,eAAO,MAAM,yBAAyB,mBAAmB,CAAC;AAE1D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU3D;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAY/D;AA6BD,wBAAgB,kBAAkB,CAAC,EAClC,IAAI,EACJ,GAAG,EACH,QAAQ,GACR,EAAE;IACF,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAgBV;AAED,wBAAgB,wBAAwB,CAAC,EACxC,GAAiB,EACjB,IAAI,EACJ,QAA2B,GAC3B,GAAE;IACF,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACb,GAAG,MAAM,EAAE,CAiBhB;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CACvB;AAED,MAAM,MAAM,kBAAkB,GAAG,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,KACV,qBAAqB,CAAC;AAY3B,wBAAgB,eAAe,CAC9B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,kBAA+B,GACrC,IAAI,CA4BN"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { posix, win32 } from "node:path";
|
|
5
|
+
const HARNESS_DETECTORS = [
|
|
6
|
+
{ id: "claude-code", executable: "claude" },
|
|
7
|
+
{ id: "github-copilot", executable: "copilot" },
|
|
8
|
+
];
|
|
9
|
+
const HARNESS_ALIASES = {
|
|
10
|
+
claude: "claude-code",
|
|
11
|
+
copilot: "github-copilot",
|
|
12
|
+
};
|
|
13
|
+
export const CAMUNDA_SKILLS_REPOSITORY = "camunda/skills";
|
|
14
|
+
export function normalizeSkillHarness(value) {
|
|
15
|
+
const normalized = value.trim().toLowerCase();
|
|
16
|
+
if (!/^[a-z0-9][a-z0-9.-]*$/.test(normalized)) {
|
|
17
|
+
throw new Error("Invalid harness ID. Use a non-empty GitHub CLI skill agent ID, such as claude-code, github-copilot, or cursor.");
|
|
18
|
+
}
|
|
19
|
+
return Object.hasOwn(HARNESS_ALIASES, normalized)
|
|
20
|
+
? HARNESS_ALIASES[normalized]
|
|
21
|
+
: normalized;
|
|
22
|
+
}
|
|
23
|
+
export function buildSkillInstallArgs(harness) {
|
|
24
|
+
return [
|
|
25
|
+
"skill",
|
|
26
|
+
"install",
|
|
27
|
+
CAMUNDA_SKILLS_REPOSITORY,
|
|
28
|
+
"--all",
|
|
29
|
+
"--agent",
|
|
30
|
+
harness,
|
|
31
|
+
"--scope",
|
|
32
|
+
"user",
|
|
33
|
+
"--force",
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
function joinForPlatform(platform, ...paths) {
|
|
37
|
+
return platform === "win32" ? win32.join(...paths) : posix.join(...paths);
|
|
38
|
+
}
|
|
39
|
+
function harnessConfigDirectories({ harness, env, home, platform, }) {
|
|
40
|
+
if (harness === "claude-code") {
|
|
41
|
+
return [
|
|
42
|
+
...(env.CLAUDE_CONFIG_DIR ? [env.CLAUDE_CONFIG_DIR] : []),
|
|
43
|
+
joinForPlatform(platform, home, ".claude"),
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
if (harness === "github-copilot") {
|
|
47
|
+
return [joinForPlatform(platform, home, ".copilot")];
|
|
48
|
+
}
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
export function executableIsOnPath({ name, env, platform, }) {
|
|
52
|
+
const pathSeparator = platform === "win32" ? ";" : ":";
|
|
53
|
+
const directories = (env.PATH ?? "")
|
|
54
|
+
.split(pathSeparator)
|
|
55
|
+
.filter((directory) => directory.length > 0);
|
|
56
|
+
const extensions = platform === "win32"
|
|
57
|
+
? (env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD")
|
|
58
|
+
.split(";")
|
|
59
|
+
.filter((extension) => extension.length > 0)
|
|
60
|
+
: [""];
|
|
61
|
+
return directories.some((directory) => extensions.some((extension) => existsSync(joinForPlatform(platform, directory, `${name}${extension}`))));
|
|
62
|
+
}
|
|
63
|
+
export function detectInstalledHarnesses({ env = process.env, home, platform = process.platform, } = {}) {
|
|
64
|
+
const userHome = home ??
|
|
65
|
+
(platform === "win32"
|
|
66
|
+
? env.USERPROFILE || env.HOME || homedir()
|
|
67
|
+
: env.HOME || homedir());
|
|
68
|
+
return HARNESS_DETECTORS.filter(({ id, executable }) => harnessConfigDirectories({
|
|
69
|
+
harness: id,
|
|
70
|
+
env,
|
|
71
|
+
home: userHome,
|
|
72
|
+
platform,
|
|
73
|
+
}).some((directory) => existsSync(directory)) ||
|
|
74
|
+
executableIsOnPath({ name: executable, env, platform })).map(({ id }) => id);
|
|
75
|
+
}
|
|
76
|
+
function runCommand(command, args) {
|
|
77
|
+
const result = spawnSync(command, args, { encoding: "utf8" });
|
|
78
|
+
return {
|
|
79
|
+
status: result.status,
|
|
80
|
+
stdout: typeof result.stdout === "string" ? result.stdout : "",
|
|
81
|
+
stderr: typeof result.stderr === "string" ? result.stderr : "",
|
|
82
|
+
...(result.error ? { error: result.error } : {}),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export function runSkillInstall(harness, runner = runCommand) {
|
|
86
|
+
const result = runner("gh", buildSkillInstallArgs(harness));
|
|
87
|
+
if (result.error) {
|
|
88
|
+
const errorCode = "code" in result.error && typeof result.error.code === "string"
|
|
89
|
+
? result.error.code
|
|
90
|
+
: undefined;
|
|
91
|
+
if (errorCode === "ENOENT") {
|
|
92
|
+
throw new Error("GitHub CLI was not found. Install GitHub CLI 2.90 or later from https://cli.github.com/.");
|
|
93
|
+
}
|
|
94
|
+
throw new Error(`Could not run GitHub CLI: ${result.error.message}`);
|
|
95
|
+
}
|
|
96
|
+
if (result.status === 0)
|
|
97
|
+
return;
|
|
98
|
+
const details = [result.stderr.trim(), result.stdout.trim()]
|
|
99
|
+
.filter((output) => output.length > 0)
|
|
100
|
+
.join("\n");
|
|
101
|
+
if (/unknown command\s+["']?skill\b/i.test(details)) {
|
|
102
|
+
throw new Error("`gh skill` requires GitHub CLI 2.90 or later. Upgrade GitHub CLI from https://cli.github.com/.");
|
|
103
|
+
}
|
|
104
|
+
throw new Error(`GitHub CLI failed to install Camunda skills${result.status === null ? "" : ` (exit code ${result.status})`}: ${details || "No details were reported."}`);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=skills-install-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-install-helpers.js","sourceRoot":"","sources":["../../../src/utils/command-local/skills-install-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AASzC,MAAM,iBAAiB,GAAG;IACzB,EAAE,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE;IAC3C,EAAE,EAAE,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE;CACD,CAAC;AAEhD,MAAM,eAAe,GAAqC;IACzD,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,gBAAgB;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;AAE1D,MAAM,UAAU,qBAAqB,CAAC,KAAa;IAClD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACd,gHAAgH,CAChH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC;QAChD,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC;QAC7B,CAAC,CAAC,UAAU,CAAC;AACf,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACpD,OAAO;QACN,OAAO;QACP,SAAS;QACT,yBAAyB;QACzB,OAAO;QACP,SAAS;QACT,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;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,CAAC;SAC1D,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;SACrC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,IAAI,iCAAiC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACd,gGAAgG,CAChG,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CACd,8CAA8C,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,MAAM,CAAC,MAAM,GAAG,KAAK,OAAO,IAAI,2BAA2B,EAAE,CACxJ,CAAC;AACH,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
export * from "./command-local/deploy-version.ts";
|
|
2
|
+
export * from "./command-local/mcp-install-helpers.ts";
|
|
2
3
|
export * from "./command-local/mcp-proxy-helpers.ts";
|
|
4
|
+
export * from "./command-local/modeler-helpers.ts";
|
|
3
5
|
export * from "./command-local/open-helpers.ts";
|
|
4
6
|
export * from "./command-local/process-instance-helpers.ts";
|
|
5
7
|
export * from "./command-local/search-helpers.ts";
|
|
8
|
+
export * from "./command-local/setup-detectors.ts";
|
|
9
|
+
export * from "./command-local/setup-prerequisites.ts";
|
|
10
|
+
export * from "./command-local/skills-install-helpers.ts";
|
|
6
11
|
export * from "./command-local/watch-constants.ts";
|
|
7
12
|
export * from "./shared/camunda-json.ts";
|
|
8
13
|
export * from "./shared/date-filter.ts";
|
|
14
|
+
export * from "./shared/deploy-resource-selection.ts";
|
|
9
15
|
export * from "./shared/ignore.ts";
|
|
10
16
|
export * from "./shared/npm-exec.ts";
|
|
11
17
|
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,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,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"}
|
package/dist/utils/index.js
CHANGED
|
@@ -5,13 +5,19 @@
|
|
|
5
5
|
// use direct sibling paths. Enforced by
|
|
6
6
|
// tests/unit/layering-import-boundary.test.ts (Rules A and B).
|
|
7
7
|
export * from "./command-local/deploy-version.js";
|
|
8
|
+
export * from "./command-local/mcp-install-helpers.js";
|
|
8
9
|
export * from "./command-local/mcp-proxy-helpers.js";
|
|
10
|
+
export * from "./command-local/modeler-helpers.js";
|
|
9
11
|
export * from "./command-local/open-helpers.js";
|
|
10
12
|
export * from "./command-local/process-instance-helpers.js";
|
|
11
13
|
export * from "./command-local/search-helpers.js";
|
|
14
|
+
export * from "./command-local/setup-detectors.js";
|
|
15
|
+
export * from "./command-local/setup-prerequisites.js";
|
|
16
|
+
export * from "./command-local/skills-install-helpers.js";
|
|
12
17
|
export * from "./command-local/watch-constants.js";
|
|
13
18
|
export * from "./shared/camunda-json.js";
|
|
14
19
|
export * from "./shared/date-filter.js";
|
|
20
|
+
export * from "./shared/deploy-resource-selection.js";
|
|
15
21
|
export * from "./shared/ignore.js";
|
|
16
22
|
export * from "./shared/npm-exec.js";
|
|
17
23
|
export * from "./shared/resource-extensions.js";
|
package/dist/utils/index.js.map
CHANGED
|
@@ -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,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,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"}
|
|
@@ -22,6 +22,18 @@
|
|
|
22
22
|
export declare const CAMUNDA_PROJECT_FILE = "camunda.json";
|
|
23
23
|
/** Legacy marker, superseded by {@link CAMUNDA_PROJECT_FILE}. */
|
|
24
24
|
export declare const PROCESS_APPLICATION_FILE = ".process-application";
|
|
25
|
+
/** Tool-agnostic error codes, shared with the parity fixtures. */
|
|
26
|
+
export type DeployResourcesErrorCode = "invalid-config" | "empty-selection" | "read-error";
|
|
27
|
+
/**
|
|
28
|
+
* Raised for an invalid `camunda.json` or `deployResources` configuration
|
|
29
|
+
* (including malformed JSON), an empty final selection, or a selected
|
|
30
|
+
* path that cannot be read (`read-error`). `code` matches the `error`
|
|
31
|
+
* value used by the shared parity fixtures.
|
|
32
|
+
*/
|
|
33
|
+
export declare class DeployResourcesError extends Error {
|
|
34
|
+
readonly code: DeployResourcesErrorCode;
|
|
35
|
+
constructor(code: DeployResourcesErrorCode, message: string);
|
|
36
|
+
}
|
|
25
37
|
/**
|
|
26
38
|
* Parsed contents of a `camunda.json` descriptor. Mirrors the JSON shape
|
|
27
39
|
* of the file so future fields can be added in place.
|
|
@@ -32,6 +44,14 @@ export interface CamundaProject {
|
|
|
32
44
|
/** ID of the linked project in Camunda Hub. */
|
|
33
45
|
projectId?: string;
|
|
34
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Raw value of the optional `deployResources` field, kept verbatim
|
|
49
|
+
* when the key is present (even when it is `null` or wrong-typed) so
|
|
50
|
+
* the integration that consumes it can validate strictly and report
|
|
51
|
+
* a precise error. Absent key → property absent. Validate with
|
|
52
|
+
* `parseDeployResources` from `deploy-resource-selection.ts`.
|
|
53
|
+
*/
|
|
54
|
+
deployResources?: unknown;
|
|
35
55
|
}
|
|
36
56
|
/**
|
|
37
57
|
* Decode descriptor bytes, tolerating the BOMs that Windows tooling
|
|
@@ -44,15 +64,16 @@ export declare function decodeCamundaJson(buffer: Buffer): string;
|
|
|
44
64
|
*
|
|
45
65
|
* @param content - Raw file contents (after {@link decodeCamundaJson}).
|
|
46
66
|
* @param source - Path used in error messages.
|
|
47
|
-
* @throws {
|
|
48
|
-
* not an object.
|
|
67
|
+
* @throws {DeployResourcesError} `invalid-config` when the content is not
|
|
68
|
+
* valid JSON or the top level is not an object.
|
|
49
69
|
*/
|
|
50
70
|
export declare function parseCamundaJson(content: string, source?: string): CamundaProject;
|
|
51
71
|
/**
|
|
52
72
|
* Read and parse the `camunda.json` descriptor in a directory.
|
|
53
73
|
* Returns `null` when no readable descriptor exists.
|
|
54
74
|
*
|
|
55
|
-
* @throws {
|
|
75
|
+
* @throws {DeployResourcesError} `invalid-config` when the file exists but
|
|
76
|
+
* is not valid JSON.
|
|
56
77
|
*/
|
|
57
78
|
export declare function readCamundaProject(dirPath: string): CamundaProject | null;
|
|
58
79
|
//# sourceMappingURL=camunda-json.d.ts.map
|
|
@@ -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;
|
|
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,kEAAkE;AAClE,MAAM,MAAM,wBAAwB,GACjC,gBAAgB,GAChB,iBAAiB,GACjB,YAAY,CAAC;AAEhB;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;gBAC5B,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM;CAK3D;AAED;;;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,CAsChB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CASzE"}
|
|
@@ -25,6 +25,20 @@ import { isRecord, normalizeToError } from "../../core/index.js";
|
|
|
25
25
|
export const CAMUNDA_PROJECT_FILE = "camunda.json";
|
|
26
26
|
/** Legacy marker, superseded by {@link CAMUNDA_PROJECT_FILE}. */
|
|
27
27
|
export const PROCESS_APPLICATION_FILE = ".process-application";
|
|
28
|
+
/**
|
|
29
|
+
* Raised for an invalid `camunda.json` or `deployResources` configuration
|
|
30
|
+
* (including malformed JSON), an empty final selection, or a selected
|
|
31
|
+
* path that cannot be read (`read-error`). `code` matches the `error`
|
|
32
|
+
* value used by the shared parity fixtures.
|
|
33
|
+
*/
|
|
34
|
+
export class DeployResourcesError extends Error {
|
|
35
|
+
code;
|
|
36
|
+
constructor(code, message) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.name = "DeployResourcesError";
|
|
39
|
+
this.code = code;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
28
42
|
/**
|
|
29
43
|
* Decode descriptor bytes, tolerating the BOMs that Windows tooling
|
|
30
44
|
* writes: UTF-8 BOM (stripped) and UTF-16LE BOM (Windows PowerShell 5.1
|
|
@@ -41,8 +55,8 @@ export function decodeCamundaJson(buffer) {
|
|
|
41
55
|
*
|
|
42
56
|
* @param content - Raw file contents (after {@link decodeCamundaJson}).
|
|
43
57
|
* @param source - Path used in error messages.
|
|
44
|
-
* @throws {
|
|
45
|
-
* not an object.
|
|
58
|
+
* @throws {DeployResourcesError} `invalid-config` when the content is not
|
|
59
|
+
* valid JSON or the top level is not an object.
|
|
46
60
|
*/
|
|
47
61
|
export function parseCamundaJson(content, source = CAMUNDA_PROJECT_FILE) {
|
|
48
62
|
// A whitespace-only file is an empty descriptor — the natural outcome
|
|
@@ -55,11 +69,11 @@ export function parseCamundaJson(content, source = CAMUNDA_PROJECT_FILE) {
|
|
|
55
69
|
parsed = JSON.parse(content);
|
|
56
70
|
}
|
|
57
71
|
catch (error) {
|
|
58
|
-
throw new
|
|
72
|
+
throw new DeployResourcesError("invalid-config", `Invalid JSON in ${source}: ${normalizeToError(error).message}. ` +
|
|
59
73
|
"camunda.json must contain a JSON object; use {} for an empty descriptor");
|
|
60
74
|
}
|
|
61
75
|
if (!isRecord(parsed)) {
|
|
62
|
-
throw new
|
|
76
|
+
throw new DeployResourcesError("invalid-config", `${source} must contain a single JSON object; use {} for an empty descriptor`);
|
|
63
77
|
}
|
|
64
78
|
const project = {};
|
|
65
79
|
const hub = parsed.hub;
|
|
@@ -67,13 +81,17 @@ export function parseCamundaJson(content, source = CAMUNDA_PROJECT_FILE) {
|
|
|
67
81
|
project.hub =
|
|
68
82
|
typeof hub.projectId === "string" ? { projectId: hub.projectId } : {};
|
|
69
83
|
}
|
|
84
|
+
if (Object.hasOwn(parsed, "deployResources")) {
|
|
85
|
+
project.deployResources = parsed.deployResources;
|
|
86
|
+
}
|
|
70
87
|
return project;
|
|
71
88
|
}
|
|
72
89
|
/**
|
|
73
90
|
* Read and parse the `camunda.json` descriptor in a directory.
|
|
74
91
|
* Returns `null` when no readable descriptor exists.
|
|
75
92
|
*
|
|
76
|
-
* @throws {
|
|
93
|
+
* @throws {DeployResourcesError} `invalid-config` when the file exists but
|
|
94
|
+
* is not valid JSON.
|
|
77
95
|
*/
|
|
78
96
|
export function readCamundaProject(dirPath) {
|
|
79
97
|
const filePath = join(dirPath, CAMUNDA_PROJECT_FILE);
|
|
@@ -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,iEAAiE;AACjE,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"camunda-json.js","sourceRoot":"","sources":["../../../src/utils/shared/camunda-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAA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