@clearlydev/nx-archweave 0.3.2 → 0.4.0
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/README.md +1 -1
- package/dist/bin/review-verdict.js +8 -249
- package/dist/eslint/index.js +28 -321
- package/dist/generators/_chunks/chunk-2WSX5YNB.js +274 -0
- package/dist/generators/_chunks/chunk-34V6HAJT.js +55 -0
- package/dist/generators/_chunks/chunk-3A6RZUCZ.js +114 -0
- package/dist/generators/_chunks/chunk-47T7NOPP.js +30 -0
- package/dist/generators/_chunks/chunk-4FJ7CLEU.js +189 -0
- package/dist/generators/_chunks/chunk-5MI3O4VZ.js +99 -0
- package/dist/generators/_chunks/chunk-6ZTIUBB2.js +139 -0
- package/dist/generators/_chunks/chunk-AIJCJ7JK.js +203 -0
- package/dist/generators/_chunks/chunk-ALSXKTLM.js +1098 -0
- package/dist/generators/_chunks/chunk-AQHV7DJS.js +656 -0
- package/dist/generators/_chunks/chunk-C2VVUWBA.js +386 -0
- package/dist/generators/_chunks/chunk-EXYZLL7A.js +234 -0
- package/dist/generators/_chunks/chunk-FQHFT5IH.js +50 -0
- package/dist/generators/_chunks/chunk-H222FPLK.js +80 -0
- package/dist/generators/_chunks/chunk-IIDOBI42.js +616 -0
- package/dist/generators/_chunks/chunk-L2RZ2LBO.js +132 -0
- package/dist/generators/_chunks/chunk-MQNQJOWA.js +217 -0
- package/dist/generators/_chunks/chunk-QQNDYJTR.js +243 -0
- package/dist/generators/_chunks/chunk-SFXU6IUS.js +0 -0
- package/dist/generators/_chunks/chunk-SNBIVIMI.js +89 -0
- package/dist/generators/_chunks/chunk-TUN34LAQ.js +8 -0
- package/dist/generators/_chunks/chunk-TXAQ2GJC.js +20 -0
- package/dist/generators/_chunks/chunk-U6LAFHSF.js +49 -0
- package/dist/generators/_chunks/chunk-URV6FLUH.js +73 -0
- package/dist/generators/_chunks/chunk-YNMLB4DL.js +25 -0
- package/dist/generators/_chunks/chunk-YY2UESLM.js +282 -0
- package/dist/generators/add-agent-rules/generator.js +11 -842
- package/dist/generators/add-backend/generator.js +11 -906
- package/dist/generators/add-fsd-lite/generator.js +12 -801
- package/dist/generators/add-github-templates/generator.js +13 -116
- package/dist/generators/add-integration/generator.js +15 -743
- package/dist/generators/add-review/generator.js +12 -1231
- package/dist/generators/allow-builds/generator.js +7 -71
- package/dist/generators/doctor/generator.js +106 -2044
- package/dist/generators/entity/generator.js +15 -604
- package/dist/generators/feature/generator.js +15 -604
- package/dist/generators/init/generator.js +68 -3376
- package/dist/generators/install-integration/generator.js +35 -871
- package/dist/generators/page/generator.js +15 -604
- package/dist/generators/record-integration/generator.js +12 -778
- package/dist/generators/shared/generator.js +15 -604
- package/dist/generators/widget/generator.js +15 -604
- package/dist/index.js +5 -663
- package/package.json +1 -1
|
@@ -1,601 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return registry.find((integration) => integration.id === id);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// ../shared/dist/lib/spawnable-command.js
|
|
20
|
-
import { statSync } from "node:fs";
|
|
21
|
-
import { win32 } from "node:path";
|
|
22
|
-
function isFile(path) {
|
|
23
|
-
try {
|
|
24
|
-
return statSync(path).isFile();
|
|
25
|
-
} catch {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
var DEFAULT_ENV = { platform: process.platform, env: process.env, isFile };
|
|
30
|
-
function envValue(env, name) {
|
|
31
|
-
const key = Object.keys(env).find((candidate) => candidate.toUpperCase() === name);
|
|
32
|
-
return key === void 0 ? void 0 : env[key];
|
|
33
|
-
}
|
|
34
|
-
function resolveWindowsCommand(command, environment) {
|
|
35
|
-
const exts = (envValue(environment.env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean);
|
|
36
|
-
const candidates = (base) => win32.extname(base) !== "" ? [base] : exts.map((ext) => base + ext);
|
|
37
|
-
if (win32.isAbsolute(command) || /[\\/]/.test(command)) {
|
|
38
|
-
return candidates(command).find(environment.isFile);
|
|
39
|
-
}
|
|
40
|
-
const dirs = (envValue(environment.env, "PATH") ?? "").split(";").filter(Boolean);
|
|
41
|
-
for (const dir of dirs) {
|
|
42
|
-
const found = candidates(win32.join(dir, command)).find(environment.isFile);
|
|
43
|
-
if (found !== void 0)
|
|
44
|
-
return found;
|
|
45
|
-
}
|
|
46
|
-
return void 0;
|
|
47
|
-
}
|
|
48
|
-
var META_CHARS = /([()\][%!^"`<>&|;, *?])/g;
|
|
49
|
-
var BIN_SHIM = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
|
|
50
|
-
function escapeCmdArgument(arg, doubleEscape = false) {
|
|
51
|
-
let quoted = arg.replace(/(\\*)"/g, '$1$1\\"');
|
|
52
|
-
quoted = quoted.replace(/(\\*)$/, "$1$1");
|
|
53
|
-
const escaped = `"${quoted}"`.replace(META_CHARS, "^$1");
|
|
54
|
-
return doubleEscape ? escaped.replace(META_CHARS, "^$1") : escaped;
|
|
55
|
-
}
|
|
56
|
-
function spawnableCommand(command, args, environment = DEFAULT_ENV) {
|
|
57
|
-
if (environment.platform !== "win32")
|
|
58
|
-
return { command, args: [...args] };
|
|
59
|
-
const resolved = resolveWindowsCommand(command, environment);
|
|
60
|
-
if (resolved === void 0 || !/\.(cmd|bat)$/i.test(resolved))
|
|
61
|
-
return { command, args: [...args] };
|
|
62
|
-
const doubleEscape = BIN_SHIM.test(resolved);
|
|
63
|
-
const line = [resolved.replace(META_CHARS, "^$1"), ...args.map((arg) => escapeCmdArgument(arg, doubleEscape))].join(" ");
|
|
64
|
-
return {
|
|
65
|
-
command: envValue(environment.env, "COMSPEC") ?? "cmd.exe",
|
|
66
|
-
args: ["/d", "/s", "/c", `"${line}"`],
|
|
67
|
-
windowsVerbatimArguments: true
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// ../integrations/dist/process/read-only-command-runner.js
|
|
72
|
-
var CLAUDE_CLI_TIMEOUT_MS = 5e3;
|
|
73
|
-
var CLAUDE_CLI_STDOUT_LIMIT_BYTES = 1048576;
|
|
74
|
-
var CLAUDE_CLI_STDERR_LIMIT_BYTES = 65536;
|
|
75
|
-
|
|
76
|
-
// ../integrations/dist/catalog/plugin-catalog.js
|
|
77
|
-
var PLUGIN_HOSTS = ["claude-code"];
|
|
78
|
-
var PLUGIN_CATALOG = [
|
|
79
|
-
{
|
|
80
|
-
// Researched 2026-07-15. The claude-code values are the ones the manifest and verifier
|
|
81
|
-
// were measured with. ponytail documents official installs for ~20 hosts; only claude-code
|
|
82
|
-
// has an adapter.
|
|
83
|
-
id: "ponytail",
|
|
84
|
-
displayName: "ponytail",
|
|
85
|
-
// The project's own tagline.
|
|
86
|
-
description: 'over-engineering review rules and skills \u2014 "makes your AI agent think like the laziest senior dev in the room"',
|
|
87
|
-
homepage: "https://ponytail.dev",
|
|
88
|
-
repository: "https://github.com/DietrichGebert/ponytail",
|
|
89
|
-
license: "MIT",
|
|
90
|
-
npmPackage: "@dietrichgebert/ponytail",
|
|
91
|
-
installDocs: "https://github.com/DietrichGebert/ponytail#install",
|
|
92
|
-
uninstallSteps: [
|
|
93
|
-
"Run this from a clone of https://github.com/DietrichGebert/ponytail (or before removing the plugin below \u2014 the script is itself a plugin file, so removing the plugin first deletes it): node scripts/uninstall.js",
|
|
94
|
-
"Then remove the plugin via your host's own command, e.g. in Claude Code: /plugin uninstall ponytail@ponytail (or use the Claude Code Desktop app: Customize > manage marketplaces > remove plugin).",
|
|
95
|
-
"See https://github.com/DietrichGebert/ponytail#uninstall for the full, current official instructions."
|
|
96
|
-
],
|
|
97
|
-
hosts: {
|
|
98
|
-
"claude-code": { name: "ponytail", marketplace: "DietrichGebert/ponytail", pluginId: "ponytail@ponytail" }
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
];
|
|
102
|
-
var PLUGIN_IDS = PLUGIN_CATALOG.map((entry) => entry.id);
|
|
103
|
-
function getCatalogEntry(id) {
|
|
104
|
-
return PLUGIN_CATALOG.find((entry) => entry.id === id);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// ../integrations/dist/hosts/claude-code/detect.js
|
|
108
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
109
|
-
import { join } from "node:path";
|
|
110
|
-
async function detectWorkspacePackage(entry, context) {
|
|
111
|
-
const npmPackage = entry.npmPackage;
|
|
112
|
-
if (npmPackage === void 0) {
|
|
113
|
-
return { installed: false, managedBy: "unknown", evidence: [] };
|
|
114
|
-
}
|
|
115
|
-
const packageJsonPath = join(context.workspaceRoot, "package.json");
|
|
116
|
-
if (!existsSync(packageJsonPath)) {
|
|
117
|
-
return { installed: false, managedBy: "unknown", evidence: [] };
|
|
118
|
-
}
|
|
119
|
-
let pkg;
|
|
120
|
-
try {
|
|
121
|
-
pkg = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
122
|
-
} catch {
|
|
123
|
-
return { installed: false, managedBy: "unknown", evidence: [] };
|
|
124
|
-
}
|
|
125
|
-
const deps = pkg["dependencies"] ?? {};
|
|
126
|
-
const devDeps = pkg["devDependencies"] ?? {};
|
|
127
|
-
const version = deps[npmPackage] ?? devDeps[npmPackage];
|
|
128
|
-
if (!version) {
|
|
129
|
-
return { installed: false, managedBy: "unknown", evidence: [] };
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
installed: true,
|
|
133
|
-
installedVersion: version,
|
|
134
|
-
managedBy: "external-tool",
|
|
135
|
-
evidence: [`package.json: ${npmPackage}@${version}`]
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// ../integrations/dist/hosts/claude-code/plan.js
|
|
140
|
-
var VERSION_DECIDED_BY_MARKETPLACE = "latest (decided by the marketplace)";
|
|
141
|
-
var WORKSPACE_FILES_BY_SCOPE = {
|
|
142
|
-
user: [],
|
|
143
|
-
project: [".claude/settings.json"],
|
|
144
|
-
local: [".claude/settings.local.json"]
|
|
145
|
-
};
|
|
146
|
-
var DEFAULT_PLUGIN_SCOPE = "project";
|
|
147
|
-
function createClaudeMarketplacePlan(entry) {
|
|
148
|
-
return async (options) => {
|
|
149
|
-
const distribution = entry.hosts["claude-code"];
|
|
150
|
-
if (options.targetEnvironment !== "claude-code" || distribution === void 0) {
|
|
151
|
-
const supported = Object.entries(entry.hosts).filter(([, value]) => value !== void 0).map(([host]) => host).join(", ");
|
|
152
|
-
throw new Error(`Target environment "${options.targetEnvironment}" is not supported by this integration. Supported: ${supported}.`);
|
|
153
|
-
}
|
|
154
|
-
const resolvedVersion = options.versionRange ?? VERSION_DECIDED_BY_MARKETPLACE;
|
|
155
|
-
const scope = options.scope ?? DEFAULT_PLUGIN_SCOPE;
|
|
156
|
-
return {
|
|
157
|
-
officialCommand: {
|
|
158
|
-
executable: "claude",
|
|
159
|
-
args: [
|
|
160
|
-
"plugin",
|
|
161
|
-
"install",
|
|
162
|
-
distribution.name,
|
|
163
|
-
"--marketplace",
|
|
164
|
-
distribution.marketplace,
|
|
165
|
-
"--scope",
|
|
166
|
-
scope,
|
|
167
|
-
"--json"
|
|
168
|
-
]
|
|
169
|
-
},
|
|
170
|
-
resolvedVersion,
|
|
171
|
-
filesCreated: [],
|
|
172
|
-
// project/local scope: Claude Code records the plugin in the workspace's own
|
|
173
|
-
// .claude settings — shown before approval as the files that will change.
|
|
174
|
-
filesModified: [...WORKSPACE_FILES_BY_SCOPE[scope]],
|
|
175
|
-
conflicts: [],
|
|
176
|
-
sourceRepository: entry.repository,
|
|
177
|
-
officialHomepage: entry.homepage,
|
|
178
|
-
license: entry.license,
|
|
179
|
-
requiresManualExecution: false
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// ../integrations/dist/hosts/claude-code/install.js
|
|
185
|
-
import { homedir } from "node:os";
|
|
186
|
-
function manualInstallSteps(entry) {
|
|
187
|
-
const distribution = entry.hosts["claude-code"];
|
|
188
|
-
if (distribution === void 0)
|
|
189
|
-
return [`See ${entry.installDocs} for the official instructions.`];
|
|
190
|
-
return [
|
|
191
|
-
`In Claude Code, send this as its own prompt: /plugin marketplace add ${distribution.marketplace}`,
|
|
192
|
-
`Then, as a second separate prompt: /plugin install ${distribution.pluginId}`,
|
|
193
|
-
`See ${entry.installDocs} for the official instructions.`
|
|
194
|
-
];
|
|
195
|
-
}
|
|
196
|
-
var CLAUDE_CLI_INSTALL_TIMEOUT_MS = 12e4;
|
|
197
|
-
var CLAUDE_CLI_INSTALL_STDOUT_LIMIT_BYTES = 1048576;
|
|
198
|
-
var CLAUDE_CLI_INSTALL_STDERR_LIMIT_BYTES = 262144;
|
|
199
|
-
function defaultRerunCommand(entry, runNx = "pnpm nx") {
|
|
200
|
-
return `${runNx} g @clearlydev/nx-archweave:install-integration --tool=${entry.id} --apply`;
|
|
201
|
-
}
|
|
202
|
-
function chatAlternative(entry) {
|
|
203
|
-
return ["Alternatively, inside a Claude Code session (the chat path):", ...manualInstallSteps(entry)];
|
|
204
|
-
}
|
|
205
|
-
var MARKETPLACE_NOTE = "If the marketplace was registered before the failure, it stays in your user settings \u2014 see `claude plugin marketplace list`.";
|
|
206
|
-
function claudeCliNotFoundSteps(entry, rerunCommand) {
|
|
207
|
-
return [
|
|
208
|
-
"The claude CLI was not found on PATH. Install the Claude Code CLI from your terminal: npm install -g @anthropic-ai/claude-code (setup guide: https://code.claude.com/docs/en/setup)",
|
|
209
|
-
`Then rerun: ${rerunCommand}`,
|
|
210
|
-
...chatAlternative(entry)
|
|
211
|
-
];
|
|
212
|
-
}
|
|
213
|
-
function claudeCliUnsupportedSteps(entry, rerunCommand, cliSaid) {
|
|
214
|
-
return [
|
|
215
|
-
`Your claude CLI does not know this command (it said: ${cliSaid}). Scriptable plugin install needs Claude Code 2.1.285 or newer: run \`claude update\`, or reinstall it with npm install -g @anthropic-ai/claude-code@latest`,
|
|
216
|
-
`Then rerun: ${rerunCommand}`,
|
|
217
|
-
...chatAlternative(entry)
|
|
218
|
-
];
|
|
219
|
-
}
|
|
220
|
-
var TAIL_CHARS = 500;
|
|
221
|
-
var UNSUPPORTED_CLI_PATTERN = /error: unknown (command|option) '(plugin|install|marketplace|--json|--marketplace|--scope)'/;
|
|
222
|
-
function tail(text) {
|
|
223
|
-
const trimmed = text.trim();
|
|
224
|
-
return trimmed.length > TAIL_CHARS ? trimmed.slice(-TAIL_CHARS) : trimmed;
|
|
225
|
-
}
|
|
226
|
-
var ESCAPED_HOME = homedir().replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
227
|
-
var HOME_PATTERN = new RegExp(`${ESCAPED_HOME}(?=[/\\\\\\s'"\`]|$)`, "g");
|
|
228
|
-
function redactHomePaths(text) {
|
|
229
|
-
let out = ESCAPED_HOME.length > 1 ? text.replace(HOME_PATTERN, "~") : text;
|
|
230
|
-
out = out.replace(/\/(?:Users|home)\/[^/\s'"`]+/g, "~");
|
|
231
|
-
out = out.replace(/[A-Za-z]:\\Users\\[^\\\s'"`]+/g, "~");
|
|
232
|
-
out = out.replace(/\/root(?=[/\s'"`]|$)/g, "~");
|
|
233
|
-
return out;
|
|
234
|
-
}
|
|
235
|
-
function parseLastJsonObject(stdout) {
|
|
236
|
-
const lines = stdout.split("\n");
|
|
237
|
-
for (let i = lines.length - 1; i >= 0; i--) {
|
|
238
|
-
const line = lines[i].trim();
|
|
239
|
-
if (!line.startsWith("{"))
|
|
240
|
-
continue;
|
|
241
|
-
try {
|
|
242
|
-
const parsed = JSON.parse(line);
|
|
243
|
-
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed))
|
|
244
|
-
return parsed;
|
|
245
|
-
} catch {
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
|
-
function renderUserCommand(command) {
|
|
251
|
-
return [command.executable, ...command.args.filter((arg) => arg !== "--json")].join(" ");
|
|
252
|
-
}
|
|
253
|
-
async function classifyRun(runner, command, cwd) {
|
|
254
|
-
let raw;
|
|
255
|
-
try {
|
|
256
|
-
raw = await runner.run({
|
|
257
|
-
executable: command.executable,
|
|
258
|
-
argv: command.args,
|
|
259
|
-
...cwd === void 0 ? {} : { cwd },
|
|
260
|
-
timeoutMs: CLAUDE_CLI_INSTALL_TIMEOUT_MS,
|
|
261
|
-
stdoutLimitBytes: CLAUDE_CLI_INSTALL_STDOUT_LIMIT_BYTES,
|
|
262
|
-
stderrLimitBytes: CLAUDE_CLI_INSTALL_STDERR_LIMIT_BYTES
|
|
263
|
-
});
|
|
264
|
-
} catch (error) {
|
|
265
|
-
const code = typeof error?.code === "string" ? error.code : "unknown";
|
|
266
|
-
return code === "ENOENT" ? { kind: "cli-not-found" } : { kind: "failed-to-start", code };
|
|
267
|
-
}
|
|
268
|
-
if (raw.timedOut)
|
|
269
|
-
return { kind: "timeout" };
|
|
270
|
-
if (raw.outputExceeded)
|
|
271
|
-
return { kind: "output-too-large" };
|
|
272
|
-
const json = parseLastJsonObject(raw.stdout);
|
|
273
|
-
const jsonSaysFailed = json !== null && json["outcome"] === "failed";
|
|
274
|
-
if (raw.exitCode === 0 && !jsonSaysFailed)
|
|
275
|
-
return { kind: "executed" };
|
|
276
|
-
if (json !== null) {
|
|
277
|
-
const message = redactHomePaths(typeof json["message"] === "string" ? json["message"] : `the claude CLI exited with code ${raw.exitCode}`);
|
|
278
|
-
const failureCode = typeof json["failureCode"] === "string" ? json["failureCode"] : void 0;
|
|
279
|
-
const shown = json["shownCommand"];
|
|
280
|
-
if (typeof shown === "object" && shown !== null)
|
|
281
|
-
return { kind: "confirmation-required", message };
|
|
282
|
-
return failureCode === void 0 ? { kind: "failed", message } : { kind: "failed", failureCode, message };
|
|
283
|
-
}
|
|
284
|
-
if (UNSUPPORTED_CLI_PATTERN.test(raw.stderr)) {
|
|
285
|
-
const line = raw.stderr.split("\n").find((l) => UNSUPPORTED_CLI_PATTERN.test(l)) ?? "";
|
|
286
|
-
return { kind: "cli-unsupported", stderrTail: redactHomePaths(line.trim()) };
|
|
287
|
-
}
|
|
288
|
-
const said = redactHomePaths(tail(raw.stderr.length > 0 ? raw.stderr : raw.stdout));
|
|
289
|
-
return { kind: "failed", message: said.length > 0 ? said : `the claude CLI exited with code ${raw.exitCode}` };
|
|
290
|
-
}
|
|
291
|
-
function manualStepsFor(entry, detail, command, rerunCommand) {
|
|
292
|
-
const chat = chatAlternative(entry);
|
|
293
|
-
const userCommand = command === null ? "" : renderUserCommand(command);
|
|
294
|
-
const rerun = `Once resolved, rerun to install, verify and record it: ${rerunCommand}`;
|
|
295
|
-
switch (detail.kind) {
|
|
296
|
-
case "executed":
|
|
297
|
-
return [];
|
|
298
|
-
case "manual-only":
|
|
299
|
-
return manualInstallSteps(entry);
|
|
300
|
-
case "cli-not-found":
|
|
301
|
-
return claudeCliNotFoundSteps(entry, rerunCommand);
|
|
302
|
-
case "failed-to-start":
|
|
303
|
-
return [
|
|
304
|
-
`The claude CLI was found but could not be started (${detail.code}) \u2014 check its permissions and your system limits.`,
|
|
305
|
-
rerun,
|
|
306
|
-
...chat
|
|
307
|
-
];
|
|
308
|
-
case "cli-unsupported":
|
|
309
|
-
return claudeCliUnsupportedSteps(entry, rerunCommand, detail.stderrTail);
|
|
310
|
-
case "confirmation-required":
|
|
311
|
-
return [
|
|
312
|
-
`The marketplace declares a command that must be confirmed by a person; nx-archweave never accepts it for you (${detail.message})`,
|
|
313
|
-
`Review it and run the install yourself: ${userCommand}`,
|
|
314
|
-
rerun,
|
|
315
|
-
...chat
|
|
316
|
-
];
|
|
317
|
-
case "failed":
|
|
318
|
-
return [`The install command did not succeed: ${detail.message}`, MARKETPLACE_NOTE, rerun, ...chat];
|
|
319
|
-
case "timeout":
|
|
320
|
-
return [
|
|
321
|
-
`The install command did not finish within ${CLAUDE_CLI_INSTALL_TIMEOUT_MS / 1e3} s and was stopped.`,
|
|
322
|
-
MARKETPLACE_NOTE,
|
|
323
|
-
rerun,
|
|
324
|
-
...chat
|
|
325
|
-
];
|
|
326
|
-
case "output-too-large":
|
|
327
|
-
return [
|
|
328
|
-
"The install command produced more output than nx-archweave is willing to buffer and was stopped.",
|
|
329
|
-
`Run it yourself to see the full output: ${userCommand}`,
|
|
330
|
-
rerun,
|
|
331
|
-
...chat
|
|
332
|
-
];
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
async function installClaudeMarketplacePlugin(entry, deps, plan, options = {}) {
|
|
336
|
-
const rerunCommand = options.rerunCommand ?? defaultRerunCommand(entry);
|
|
337
|
-
const detail = plan.officialCommand === null ? { kind: "manual-only" } : await classifyRun(deps.runner, plan.officialCommand, options.cwd);
|
|
338
|
-
const executed = detail.kind === "executed";
|
|
339
|
-
const result = {
|
|
340
|
-
executed,
|
|
341
|
-
// One command: it either reached exit 0 or it did not. What a failed run may
|
|
342
|
-
// have left behind is re-checked live by install-integration, not guessed here.
|
|
343
|
-
partialFailure: false,
|
|
344
|
-
filesCreated: [],
|
|
345
|
-
// The workspace files the plan said the host would change (project/local scope);
|
|
346
|
-
// Claude's own plugin store is outside the workspace and never listed.
|
|
347
|
-
filesModified: executed ? [...plan.filesModified] : [],
|
|
348
|
-
manualStepsRemaining: manualStepsFor(entry, detail, plan.officialCommand, rerunCommand)
|
|
349
|
-
};
|
|
350
|
-
return { result, detail };
|
|
351
|
-
}
|
|
352
|
-
function projectMarketplaceCommand(entry) {
|
|
353
|
-
const distribution = entry.hosts["claude-code"];
|
|
354
|
-
if (distribution === void 0)
|
|
355
|
-
return null;
|
|
356
|
-
return {
|
|
357
|
-
executable: "claude",
|
|
358
|
-
args: ["plugin", "marketplace", "add", distribution.marketplace, "--scope", "project", "--json"]
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
function createClaudeMarketplaceInstall(entry, deps) {
|
|
362
|
-
return async (plan) => (await installClaudeMarketplacePlugin(entry, deps, plan)).result;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// ../integrations/dist/hosts/claude-code/verify-via-claude-cli.js
|
|
366
|
-
import { realpathSync } from "node:fs";
|
|
367
|
-
import { resolve } from "node:path";
|
|
368
|
-
|
|
369
|
-
// ../integrations/dist/hosts/claude-code/parse-claude-plugin-list.js
|
|
370
|
-
var KNOWN_SCOPES = /* @__PURE__ */ new Set(["user", "project", "local", "managed"]);
|
|
371
|
-
function isKnownScope(scope) {
|
|
372
|
-
return KNOWN_SCOPES.has(scope);
|
|
373
|
-
}
|
|
374
|
-
function isValidEntry(value) {
|
|
375
|
-
if (typeof value !== "object" || value === null) {
|
|
376
|
-
return false;
|
|
377
|
-
}
|
|
378
|
-
const record = value;
|
|
379
|
-
if (typeof record["id"] !== "string") {
|
|
380
|
-
return false;
|
|
381
|
-
}
|
|
382
|
-
if (typeof record["enabled"] !== "boolean") {
|
|
383
|
-
return false;
|
|
384
|
-
}
|
|
385
|
-
if (typeof record["scope"] !== "string" || record["scope"].length === 0) {
|
|
386
|
-
return false;
|
|
387
|
-
}
|
|
388
|
-
if (record["version"] !== void 0 && typeof record["version"] !== "string") {
|
|
389
|
-
return false;
|
|
390
|
-
}
|
|
391
|
-
return true;
|
|
392
|
-
}
|
|
393
|
-
function parseClaudePluginList(rawStdout, options = {}) {
|
|
394
|
-
let parsed;
|
|
395
|
-
try {
|
|
396
|
-
parsed = JSON.parse(rawStdout);
|
|
397
|
-
} catch {
|
|
398
|
-
return { ok: false, reason: "invalid-json" };
|
|
399
|
-
}
|
|
400
|
-
if (!Array.isArray(parsed)) {
|
|
401
|
-
return { ok: false, reason: "non-array" };
|
|
402
|
-
}
|
|
403
|
-
const entries = [];
|
|
404
|
-
const otherScopeIds = [];
|
|
405
|
-
for (const item of parsed) {
|
|
406
|
-
if (!isValidEntry(item)) {
|
|
407
|
-
return { ok: false, reason: "missing-fields" };
|
|
408
|
-
}
|
|
409
|
-
if (typeof item.projectPath === "string" && options.isThisWorkspace && !options.isThisWorkspace(item.projectPath)) {
|
|
410
|
-
continue;
|
|
411
|
-
}
|
|
412
|
-
const scope = item.scope;
|
|
413
|
-
if (!isKnownScope(scope)) {
|
|
414
|
-
otherScopeIds.push(item.id);
|
|
415
|
-
continue;
|
|
416
|
-
}
|
|
417
|
-
entries.push({
|
|
418
|
-
id: item.id,
|
|
419
|
-
version: item.version,
|
|
420
|
-
scope,
|
|
421
|
-
enabled: item.enabled
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
return { ok: true, entries, otherScopeIds };
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
// ../integrations/dist/hosts/claude-code/match-claude-plugin.js
|
|
428
|
-
function matchClaudePlugin(entries, pluginId) {
|
|
429
|
-
const matches = entries.filter((candidate) => candidate.id === pluginId);
|
|
430
|
-
if (matches.length === 0) {
|
|
431
|
-
return { kind: "absent" };
|
|
432
|
-
}
|
|
433
|
-
if (matches.length > 1) {
|
|
434
|
-
return { kind: "ambiguous", entries: matches };
|
|
435
|
-
}
|
|
436
|
-
return { kind: "matched", entry: matches[0] };
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
// ../integrations/dist/hosts/claude-code/claude-cli-verification-result.js
|
|
440
|
-
function evaluateClaudeCliMatch(match) {
|
|
441
|
-
switch (match.kind) {
|
|
442
|
-
case "matched":
|
|
443
|
-
return match.entry.enabled ? { status: "verified", version: match.entry.version, scope: match.entry.scope } : { status: "installed-but-disabled", scope: match.entry.scope };
|
|
444
|
-
case "absent":
|
|
445
|
-
return { status: "absent" };
|
|
446
|
-
case "ambiguous":
|
|
447
|
-
return { status: "ambiguous" };
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
// ../integrations/dist/hosts/claude-code/verify-via-claude-cli.js
|
|
452
|
-
async function verifyViaClaudeCli(runner, pluginId, cwd) {
|
|
453
|
-
let raw;
|
|
454
|
-
try {
|
|
455
|
-
raw = await runner.run({
|
|
456
|
-
executable: "claude",
|
|
457
|
-
argv: ["plugin", "list", "--json"],
|
|
458
|
-
...cwd === void 0 ? {} : { cwd },
|
|
459
|
-
timeoutMs: CLAUDE_CLI_TIMEOUT_MS,
|
|
460
|
-
stdoutLimitBytes: CLAUDE_CLI_STDOUT_LIMIT_BYTES,
|
|
461
|
-
stderrLimitBytes: CLAUDE_CLI_STDERR_LIMIT_BYTES
|
|
462
|
-
});
|
|
463
|
-
} catch {
|
|
464
|
-
return { source: "claude-cli-unavailable", reason: "not-found" };
|
|
465
|
-
}
|
|
466
|
-
if (raw.timedOut) {
|
|
467
|
-
return { source: "claude-cli-unavailable", reason: "timeout" };
|
|
468
|
-
}
|
|
469
|
-
if (raw.outputExceeded) {
|
|
470
|
-
return { source: "claude-cli-unavailable", reason: "output-too-large" };
|
|
471
|
-
}
|
|
472
|
-
if (raw.exitCode !== 0) {
|
|
473
|
-
return { source: "claude-cli-unavailable", reason: "non-zero-exit" };
|
|
474
|
-
}
|
|
475
|
-
const parsed = parseClaudePluginList(raw.stdout, cwd === void 0 ? {} : { isThisWorkspace: samePathAs(cwd) });
|
|
476
|
-
if (!parsed.ok) {
|
|
477
|
-
return {
|
|
478
|
-
source: "claude-cli-unavailable",
|
|
479
|
-
reason: parsed.reason === "invalid-json" ? "invalid-json" : "unexpected-schema"
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
const match = matchClaudePlugin(parsed.entries, pluginId);
|
|
483
|
-
if (parsed.otherScopeIds.includes(pluginId)) {
|
|
484
|
-
return match.kind === "absent" ? { source: "claude-cli-unavailable", reason: "unexpected-schema" } : { source: "claude-cli", outcome: { status: "ambiguous" } };
|
|
485
|
-
}
|
|
486
|
-
return { source: "claude-cli", outcome: evaluateClaudeCliMatch(match) };
|
|
487
|
-
}
|
|
488
|
-
function canonical(path) {
|
|
489
|
-
try {
|
|
490
|
-
return realpathSync(path);
|
|
491
|
-
} catch {
|
|
492
|
-
return resolve(path);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
function samePathAs(workspaceRoot) {
|
|
496
|
-
const root = canonical(workspaceRoot);
|
|
497
|
-
return (projectPath) => canonical(projectPath) === root;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
// ../integrations/dist/hosts/claude-code/verify.js
|
|
501
|
-
async function verifyClaudeMarketplacePlugin(entry, deps, context) {
|
|
502
|
-
const detect = deps.detect ?? detectWorkspacePackage;
|
|
503
|
-
const pluginId = entry.hosts["claude-code"]?.pluginId;
|
|
504
|
-
if (pluginId === void 0) {
|
|
505
|
-
throw new Error(`${entry.displayName} has no Claude Code distribution \u2014 it cannot be verified through the claude CLI.`);
|
|
506
|
-
}
|
|
507
|
-
const cliResult = await verifyViaClaudeCli(deps.runner, pluginId, context.workspaceRoot);
|
|
508
|
-
if (cliResult.source === "claude-cli") {
|
|
509
|
-
switch (cliResult.outcome.status) {
|
|
510
|
-
case "verified":
|
|
511
|
-
return {
|
|
512
|
-
source: "claude-cli",
|
|
513
|
-
result: { verified: true, resolvedVersion: cliResult.outcome.version, problems: [] }
|
|
514
|
-
};
|
|
515
|
-
case "installed-but-disabled":
|
|
516
|
-
return {
|
|
517
|
-
source: "claude-cli",
|
|
518
|
-
result: {
|
|
519
|
-
verified: false,
|
|
520
|
-
problems: [
|
|
521
|
-
`${entry.displayName} is installed (scope: ${cliResult.outcome.scope}) but currently disabled in Claude Code.`,
|
|
522
|
-
"Enable it before recording this integration \u2014 a disabled plugin is never recorded as verified."
|
|
523
|
-
]
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
case "absent":
|
|
527
|
-
return {
|
|
528
|
-
source: "claude-cli",
|
|
529
|
-
result: {
|
|
530
|
-
verified: false,
|
|
531
|
-
problems: [
|
|
532
|
-
`${pluginId} was not found in the installed Claude Code plugin list.`,
|
|
533
|
-
`Install it (${defaultRerunCommand(entry)}) or complete the manual Claude Code steps, then try again.`
|
|
534
|
-
]
|
|
535
|
-
}
|
|
536
|
-
};
|
|
537
|
-
case "ambiguous":
|
|
538
|
-
return {
|
|
539
|
-
source: "claude-cli",
|
|
540
|
-
result: {
|
|
541
|
-
verified: false,
|
|
542
|
-
problems: [
|
|
543
|
-
`Verification error: more than one installed plugin matches ${pluginId} exactly. This is ambiguous and cannot be safely resolved automatically.`
|
|
544
|
-
]
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
if (cliResult.reason === "not-found") {
|
|
550
|
-
const detected = await detect(entry, context);
|
|
551
|
-
if (detected.installed) {
|
|
552
|
-
return {
|
|
553
|
-
source: "package-json",
|
|
554
|
-
result: { verified: true, resolvedVersion: detected.installedVersion, problems: [] }
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
return {
|
|
558
|
-
source: "package-json",
|
|
559
|
-
result: {
|
|
560
|
-
verified: false,
|
|
561
|
-
problems: [
|
|
562
|
-
`The claude CLI was not found, and ${entry.displayName} was not found as a workspace dependency either.`,
|
|
563
|
-
`Install the Claude Code CLI to use the authoritative verification signal, or add ${entry.displayName} as a workspace dependency for the weaker fallback signal.`
|
|
564
|
-
]
|
|
565
|
-
}
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
return {
|
|
569
|
-
source: "claude-cli",
|
|
570
|
-
result: {
|
|
571
|
-
verified: false,
|
|
572
|
-
problems: [`Verification error: the claude CLI returned an unexpected result (${cliResult.reason}).`]
|
|
573
|
-
}
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
function createClaudeMarketplaceVerifier(entry, deps) {
|
|
577
|
-
return async (context) => (await verifyClaudeMarketplacePlugin(entry, deps, context)).result;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
// ../integrations/dist/catalog/create-catalog-integration.js
|
|
581
|
-
function createCatalogIntegration(entry, deps) {
|
|
582
|
-
return {
|
|
583
|
-
id: entry.id,
|
|
584
|
-
displayName: entry.displayName,
|
|
585
|
-
homepage: entry.homepage,
|
|
586
|
-
repository: entry.repository,
|
|
587
|
-
license: entry.license,
|
|
588
|
-
supportedEnvironments: PLUGIN_HOSTS.filter((host) => entry.hosts[host] !== void 0),
|
|
589
|
-
detect: (context) => detectWorkspacePackage(entry, context),
|
|
590
|
-
plan: createClaudeMarketplacePlan(entry),
|
|
591
|
-
install: createClaudeMarketplaceInstall(entry, { runner: deps.runner }),
|
|
592
|
-
verify: createClaudeMarketplaceVerifier(entry, { runner: deps.runner }),
|
|
593
|
-
uninstallInstructions: async () => [...entry.uninstallSteps]
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
function createCatalogIntegrations(deps) {
|
|
597
|
-
return PLUGIN_CATALOG.map((entry) => createCatalogIntegration(entry, deps));
|
|
598
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
diskRunNx
|
|
3
|
+
} from "../_chunks/chunk-47T7NOPP.js";
|
|
4
|
+
import {
|
|
5
|
+
DEFAULT_PLUGIN_SCOPE,
|
|
6
|
+
PLUGIN_IDS,
|
|
7
|
+
createIntegrationsCompositionRoot,
|
|
8
|
+
getCatalogEntry,
|
|
9
|
+
manualInstallSteps,
|
|
10
|
+
projectMarketplaceCommand,
|
|
11
|
+
renderUserCommand
|
|
12
|
+
} from "../_chunks/chunk-AQHV7DJS.js";
|
|
13
|
+
import "../_chunks/chunk-34V6HAJT.js";
|
|
14
|
+
import "../_chunks/chunk-EXYZLL7A.js";
|
|
15
|
+
import "../_chunks/chunk-FQHFT5IH.js";
|
|
599
16
|
|
|
600
17
|
// src/generators/add-integration/render.ts
|
|
601
18
|
function renderIntegrationPlan(view) {
|
|
@@ -628,151 +45,6 @@ function renderIntegrationPlan(view) {
|
|
|
628
45
|
return lines.join("\n");
|
|
629
46
|
}
|
|
630
47
|
|
|
631
|
-
// src/generators/shared/run-nx.ts
|
|
632
|
-
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
633
|
-
import { join as join2 } from "node:path";
|
|
634
|
-
|
|
635
|
-
// ../template-engine/dist/environment/package-manager.js
|
|
636
|
-
var LOCKFILES = [
|
|
637
|
-
["yarn", ["yarn.lock"]],
|
|
638
|
-
["bun", ["bun.lock", "bun.lockb"]],
|
|
639
|
-
["npm", ["package-lock.json"]]
|
|
640
|
-
];
|
|
641
|
-
function detectWorkspacePackageManager(exists, read = () => void 0) {
|
|
642
|
-
if (exists("pnpm-lock.yaml") || exists("pnpm-workspace.yaml"))
|
|
643
|
-
return "pnpm";
|
|
644
|
-
const found = LOCKFILES.filter(([, files]) => files.some((file) => exists(file))).map(([pm]) => pm);
|
|
645
|
-
if (found.length <= 1)
|
|
646
|
-
return found[0] ?? null;
|
|
647
|
-
const declared = /"packageManager"\s*:\s*"(npm|yarn|bun)@/.exec(read("package.json") ?? "")?.[1];
|
|
648
|
-
const named = found.find((pm) => pm === declared);
|
|
649
|
-
if (named)
|
|
650
|
-
return named;
|
|
651
|
-
return found.includes("npm") ? "npm" : found[0];
|
|
652
|
-
}
|
|
653
|
-
function packageManagerCommands(pm, flavor = "classic") {
|
|
654
|
-
switch (pm) {
|
|
655
|
-
case "pnpm":
|
|
656
|
-
return { addDevAtRoot: (spec) => `pnpm add -D -w ${spec}`, addAtRoot: (spec) => `pnpm add -w ${spec}`, runNx: "pnpm nx", install: "pnpm install", workspaceRegistration: "pnpm-workspace.yaml" };
|
|
657
|
-
case "yarn":
|
|
658
|
-
return {
|
|
659
|
-
addDevAtRoot: (spec) => flavor === "berry" ? `yarn add -D ${spec}` : `yarn add -D -W ${spec}`,
|
|
660
|
-
addAtRoot: (spec) => flavor === "berry" ? `yarn add ${spec}` : `yarn add -W ${spec}`,
|
|
661
|
-
runNx: "yarn nx",
|
|
662
|
-
install: "yarn install",
|
|
663
|
-
workspaceRegistration: "package.json workspaces"
|
|
664
|
-
};
|
|
665
|
-
case "bun":
|
|
666
|
-
return { addDevAtRoot: (spec) => `bun add -d ${spec}`, addAtRoot: (spec) => `bun add ${spec}`, runNx: "bun nx", install: "bun install", workspaceRegistration: "package.json workspaces" };
|
|
667
|
-
case "npm":
|
|
668
|
-
return { addDevAtRoot: (spec) => `npm install -D ${spec}`, addAtRoot: (spec) => `npm install ${spec}`, runNx: "npm exec nx --", install: "npm install", workspaceRegistration: "package.json workspaces" };
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
// src/generators/shared/toolkit-config-file.ts
|
|
673
|
-
var TOOLKIT_CONFIG_PATH = "toolkit.config.json";
|
|
674
|
-
function recordedChoice(config, key, allowed) {
|
|
675
|
-
const value = config?.[key];
|
|
676
|
-
return typeof value === "string" && allowed.includes(value) ? value : void 0;
|
|
677
|
-
}
|
|
678
|
-
var RECORDED_PACKAGE_MANAGERS = ["pnpm", "npm", "yarn", "bun"];
|
|
679
|
-
function workspacePackageManager(exists, read, config) {
|
|
680
|
-
return detectWorkspacePackageManager(exists, read) ?? recordedChoice(config, "packageManager", RECORDED_PACKAGE_MANAGERS) ?? null;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
// src/generators/shared/run-nx.ts
|
|
684
|
-
function runNxFor(exists, read) {
|
|
685
|
-
let config = null;
|
|
686
|
-
try {
|
|
687
|
-
const parsed = JSON.parse(read(TOOLKIT_CONFIG_PATH) ?? "null");
|
|
688
|
-
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) config = parsed;
|
|
689
|
-
} catch {
|
|
690
|
-
}
|
|
691
|
-
return packageManagerCommands(workspacePackageManager(exists, read, config) ?? "pnpm").runNx;
|
|
692
|
-
}
|
|
693
|
-
function diskRunNx(root) {
|
|
694
|
-
return runNxFor(
|
|
695
|
-
(path) => existsSync2(join2(root, path)),
|
|
696
|
-
(path) => existsSync2(join2(root, path)) ? readFileSync2(join2(root, path), "utf-8") : void 0
|
|
697
|
-
);
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
// src/runtime/node-command-runner.ts
|
|
701
|
-
import { spawn } from "node:child_process";
|
|
702
|
-
var KILL_GRACE_MS = 500;
|
|
703
|
-
var NodeCommandRunner = class {
|
|
704
|
-
run(input) {
|
|
705
|
-
return new Promise((resolve2, reject) => {
|
|
706
|
-
let stdout = "";
|
|
707
|
-
let stderr = "";
|
|
708
|
-
let timedOut = false;
|
|
709
|
-
let outputExceeded = false;
|
|
710
|
-
let settled = false;
|
|
711
|
-
let killTimer;
|
|
712
|
-
const spawnable = spawnableCommand(input.executable, input.argv);
|
|
713
|
-
const child = spawn(spawnable.command, spawnable.args, {
|
|
714
|
-
cwd: input.cwd,
|
|
715
|
-
shell: false,
|
|
716
|
-
windowsVerbatimArguments: spawnable.windowsVerbatimArguments,
|
|
717
|
-
windowsHide: true,
|
|
718
|
-
// No stdin: nothing here ever answers a prompt (a command that wants
|
|
719
|
-
// confirmation must fail fast instead of waiting on an open pipe).
|
|
720
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
721
|
-
});
|
|
722
|
-
const terminate = () => {
|
|
723
|
-
child.kill("SIGTERM");
|
|
724
|
-
killTimer = setTimeout(() => {
|
|
725
|
-
child.kill("SIGKILL");
|
|
726
|
-
}, KILL_GRACE_MS);
|
|
727
|
-
};
|
|
728
|
-
const timer = setTimeout(() => {
|
|
729
|
-
timedOut = true;
|
|
730
|
-
terminate();
|
|
731
|
-
}, input.timeoutMs);
|
|
732
|
-
child.stdout.on("data", (chunk) => {
|
|
733
|
-
stdout += chunk.toString("utf8");
|
|
734
|
-
if (Buffer.byteLength(stdout, "utf8") > input.stdoutLimitBytes) {
|
|
735
|
-
outputExceeded = true;
|
|
736
|
-
terminate();
|
|
737
|
-
}
|
|
738
|
-
});
|
|
739
|
-
child.stderr.on("data", (chunk) => {
|
|
740
|
-
stderr += chunk.toString("utf8");
|
|
741
|
-
if (Buffer.byteLength(stderr, "utf8") > input.stderrLimitBytes) {
|
|
742
|
-
outputExceeded = true;
|
|
743
|
-
terminate();
|
|
744
|
-
}
|
|
745
|
-
});
|
|
746
|
-
child.on("error", (error) => {
|
|
747
|
-
if (settled) return;
|
|
748
|
-
settled = true;
|
|
749
|
-
clearTimeout(timer);
|
|
750
|
-
clearTimeout(killTimer);
|
|
751
|
-
reject(error);
|
|
752
|
-
});
|
|
753
|
-
child.on("close", (code) => {
|
|
754
|
-
if (settled) return;
|
|
755
|
-
settled = true;
|
|
756
|
-
clearTimeout(timer);
|
|
757
|
-
clearTimeout(killTimer);
|
|
758
|
-
resolve2({ stdout, stderr, exitCode: code, timedOut, outputExceeded });
|
|
759
|
-
});
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
|
|
764
|
-
// src/runtime/integrations-composition-root.ts
|
|
765
|
-
function createIntegrationsCompositionRoot(deps = {}) {
|
|
766
|
-
const runner = deps.runner ?? new NodeCommandRunner();
|
|
767
|
-
const registry = createIntegrationRegistry(createCatalogIntegrations({ runner }));
|
|
768
|
-
return {
|
|
769
|
-
registry,
|
|
770
|
-
runner,
|
|
771
|
-
getIntegration: (id) => getIntegration(registry, id),
|
|
772
|
-
listIntegrations: () => listIntegrations(registry)
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
|
|
776
48
|
// src/generators/add-integration/generator.ts
|
|
777
49
|
async function addIntegrationGenerator(tree, options, deps = {}) {
|
|
778
50
|
const root = deps.integrationsRoot ?? createIntegrationsCompositionRoot();
|