@maz-ui/node 5.0.0 → 5.1.0-beta.1

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 CHANGED
@@ -18,6 +18,7 @@ npm install @maz-ui/node
18
18
  - 🔧 **Highly configurable** - custom loggers with different levels and reporters
19
19
  - 🛡️ **Error handling** - comprehensive error management
20
20
  - 🎯 **Multiple log types** - info, debug, trace, start, ready, fail, box
21
+ - 🤖 **AI agents setup** - `setupAgents` configures the AI coding agents of a project for maz-ui (rules and MCP server), as `npx @maz-ui/mcp init` does: [documentation](https://maz-ui.com/ecosystem/node/setup-agents)
21
22
 
22
23
  ## Usage
23
24
 
@@ -364,6 +365,7 @@ All logger methods automatically handle error objects using `getErrorMessage` ut
364
365
 
365
366
  - **consola** - Elegant console logging with fancy formatting
366
367
  - **@maz-ui/utils** - Error message formatting
368
+ - **jsonc-parser** - Edits the MCP config files of `setupAgents` while keeping their formatting and comments
367
369
  - **Node.js built-ins** - child_process for command execution
368
370
 
369
371
  ## Requirements
package/dist/index.d.mts CHANGED
@@ -168,5 +168,88 @@ declare function redactSecrets(input: string): string;
168
168
  */
169
169
  declare function redactError<T>(error: T): T;
170
170
 
171
- export { createLogger, execPromise, logger, printBanner, redactError, redactSecrets };
172
- export type { ExecPromiseOptions, LogLevel, Logger, LoggerOptions };
171
+ /**
172
+ * AI coding agents supported by `setupAgents`.
173
+ *
174
+ * - `claude`: Claude Code rule (`.claude/rules/maz-ui.md`) and MCP server (`.mcp.json`)
175
+ * - `agents-md`: section in `AGENTS.md` (Codex, Cursor, Copilot, Windsurf, Zed, Gemini...)
176
+ * - `cursor`: MCP server in `.cursor/mcp.json` (rules come from `AGENTS.md`)
177
+ * - `vscode`: MCP server in `.vscode/mcp.json` for GitHub Copilot (rules come from `AGENTS.md`)
178
+ */
179
+ type AgentTarget = 'claude' | 'agents-md' | 'cursor' | 'vscode';
180
+ declare const AGENT_TARGETS: AgentTarget[];
181
+ interface SetupAgentsOptions {
182
+ /** Root of the project (where `AGENTS.md`, `.claude/`, `.mcp.json` live) */
183
+ rootDir: string;
184
+ /** Agents to configure. Default: the agents detected in the project */
185
+ targets?: AgentTarget[];
186
+ /** Write the maz-ui rules (Claude Code rule, `AGENTS.md` section). Default `true` */
187
+ rules?: boolean;
188
+ /** Register the maz-ui MCP server. Default `true` */
189
+ mcp?: boolean;
190
+ /** Compute the changes without writing anything */
191
+ dryRun?: boolean;
192
+ /** Remove everything `setupAgents` added */
193
+ remove?: boolean;
194
+ /** Folder of the maz-ui agent docs. Default: `docs/` of the maz-ui package installed in `rootDir` */
195
+ docsDir?: string;
196
+ /** Command used to start the MCP server */
197
+ mcpServer?: {
198
+ command: string;
199
+ args: string[];
200
+ };
201
+ }
202
+ type SetupAgentsAction = 'create' | 'update' | 'remove' | 'unchanged' | 'skip';
203
+ interface SetupAgentsChange {
204
+ /** Path relative to `rootDir` */
205
+ file: string;
206
+ action: SetupAgentsAction;
207
+ reason?: string;
208
+ }
209
+ interface SetupAgentsResult {
210
+ targets: AgentTarget[];
211
+ version: string;
212
+ changes: SetupAgentsChange[];
213
+ }
214
+ declare const MANAGED_MARKER = "Managed by maz-ui";
215
+ declare const AGENTS_MD_BEGIN = "<!-- BEGIN:maz-ui -->";
216
+ declare const AGENTS_MD_END = "<!-- END:maz-ui -->";
217
+ declare const MCP_SERVER_NAME = "maz-ui";
218
+ declare const DEFAULT_MCP_SERVER: {
219
+ command: string;
220
+ args: string[];
221
+ };
222
+ /** Detects the AI agents configured in a project */
223
+ declare function detectAgentTargets(rootDir: string): AgentTarget[];
224
+ interface AgentDocs {
225
+ directory: string;
226
+ version: string;
227
+ claudeRule: string;
228
+ agentsMdSection: string;
229
+ }
230
+ /**
231
+ * Finds `node_modules/<name>` from a directory up to the filesystem root, like
232
+ * the Node resolution but without the global folders (`NODE_PATH`), so only a
233
+ * package installed for the project is found.
234
+ */
235
+ declare function findInstalledPackage(fromDir: string, name: string): string | undefined;
236
+ /** Reads the agent files shipped in `maz-ui/docs/agents` */
237
+ /** Version of an installed package, read from its `package.json` */
238
+ declare function readPackageVersion(packageDir: string): string | undefined;
239
+ /**
240
+ * Finds a package installed in a project: in the `node_modules` of the
241
+ * project root and of its workspace folders (`apps/*`, `packages/*`, for
242
+ * monorepos without hoisting), then in the parent folders.
243
+ */
244
+ declare function findProjectPackage(rootDir: string, name: string): string | undefined;
245
+ declare function readAgentDocs(rootDir: string, docsDir?: string): AgentDocs;
246
+ /**
247
+ * Configures the AI coding agents of a project to use maz-ui: rules (version
248
+ * matched with the installed maz-ui) and the maz-ui MCP server. Idempotent and
249
+ * conservative: it only writes files it owns, a delimited section of
250
+ * `AGENTS.md` and its own entry of the MCP config files.
251
+ */
252
+ declare function setupAgents(options: SetupAgentsOptions): SetupAgentsResult;
253
+
254
+ export { AGENTS_MD_BEGIN, AGENTS_MD_END, AGENT_TARGETS, DEFAULT_MCP_SERVER, MANAGED_MARKER, MCP_SERVER_NAME, createLogger, detectAgentTargets, execPromise, findInstalledPackage, findProjectPackage, logger, printBanner, readAgentDocs, readPackageVersion, redactError, redactSecrets, setupAgents };
255
+ export type { AgentDocs, AgentTarget, ExecPromiseOptions, LogLevel, Logger, LoggerOptions, SetupAgentsAction, SetupAgentsChange, SetupAgentsOptions, SetupAgentsResult };
package/dist/index.d.ts CHANGED
@@ -168,5 +168,88 @@ declare function redactSecrets(input: string): string;
168
168
  */
169
169
  declare function redactError<T>(error: T): T;
170
170
 
171
- export { createLogger, execPromise, logger, printBanner, redactError, redactSecrets };
172
- export type { ExecPromiseOptions, LogLevel, Logger, LoggerOptions };
171
+ /**
172
+ * AI coding agents supported by `setupAgents`.
173
+ *
174
+ * - `claude`: Claude Code rule (`.claude/rules/maz-ui.md`) and MCP server (`.mcp.json`)
175
+ * - `agents-md`: section in `AGENTS.md` (Codex, Cursor, Copilot, Windsurf, Zed, Gemini...)
176
+ * - `cursor`: MCP server in `.cursor/mcp.json` (rules come from `AGENTS.md`)
177
+ * - `vscode`: MCP server in `.vscode/mcp.json` for GitHub Copilot (rules come from `AGENTS.md`)
178
+ */
179
+ type AgentTarget = 'claude' | 'agents-md' | 'cursor' | 'vscode';
180
+ declare const AGENT_TARGETS: AgentTarget[];
181
+ interface SetupAgentsOptions {
182
+ /** Root of the project (where `AGENTS.md`, `.claude/`, `.mcp.json` live) */
183
+ rootDir: string;
184
+ /** Agents to configure. Default: the agents detected in the project */
185
+ targets?: AgentTarget[];
186
+ /** Write the maz-ui rules (Claude Code rule, `AGENTS.md` section). Default `true` */
187
+ rules?: boolean;
188
+ /** Register the maz-ui MCP server. Default `true` */
189
+ mcp?: boolean;
190
+ /** Compute the changes without writing anything */
191
+ dryRun?: boolean;
192
+ /** Remove everything `setupAgents` added */
193
+ remove?: boolean;
194
+ /** Folder of the maz-ui agent docs. Default: `docs/` of the maz-ui package installed in `rootDir` */
195
+ docsDir?: string;
196
+ /** Command used to start the MCP server */
197
+ mcpServer?: {
198
+ command: string;
199
+ args: string[];
200
+ };
201
+ }
202
+ type SetupAgentsAction = 'create' | 'update' | 'remove' | 'unchanged' | 'skip';
203
+ interface SetupAgentsChange {
204
+ /** Path relative to `rootDir` */
205
+ file: string;
206
+ action: SetupAgentsAction;
207
+ reason?: string;
208
+ }
209
+ interface SetupAgentsResult {
210
+ targets: AgentTarget[];
211
+ version: string;
212
+ changes: SetupAgentsChange[];
213
+ }
214
+ declare const MANAGED_MARKER = "Managed by maz-ui";
215
+ declare const AGENTS_MD_BEGIN = "<!-- BEGIN:maz-ui -->";
216
+ declare const AGENTS_MD_END = "<!-- END:maz-ui -->";
217
+ declare const MCP_SERVER_NAME = "maz-ui";
218
+ declare const DEFAULT_MCP_SERVER: {
219
+ command: string;
220
+ args: string[];
221
+ };
222
+ /** Detects the AI agents configured in a project */
223
+ declare function detectAgentTargets(rootDir: string): AgentTarget[];
224
+ interface AgentDocs {
225
+ directory: string;
226
+ version: string;
227
+ claudeRule: string;
228
+ agentsMdSection: string;
229
+ }
230
+ /**
231
+ * Finds `node_modules/<name>` from a directory up to the filesystem root, like
232
+ * the Node resolution but without the global folders (`NODE_PATH`), so only a
233
+ * package installed for the project is found.
234
+ */
235
+ declare function findInstalledPackage(fromDir: string, name: string): string | undefined;
236
+ /** Reads the agent files shipped in `maz-ui/docs/agents` */
237
+ /** Version of an installed package, read from its `package.json` */
238
+ declare function readPackageVersion(packageDir: string): string | undefined;
239
+ /**
240
+ * Finds a package installed in a project: in the `node_modules` of the
241
+ * project root and of its workspace folders (`apps/*`, `packages/*`, for
242
+ * monorepos without hoisting), then in the parent folders.
243
+ */
244
+ declare function findProjectPackage(rootDir: string, name: string): string | undefined;
245
+ declare function readAgentDocs(rootDir: string, docsDir?: string): AgentDocs;
246
+ /**
247
+ * Configures the AI coding agents of a project to use maz-ui: rules (version
248
+ * matched with the installed maz-ui) and the maz-ui MCP server. Idempotent and
249
+ * conservative: it only writes files it owns, a delimited section of
250
+ * `AGENTS.md` and its own entry of the MCP config files.
251
+ */
252
+ declare function setupAgents(options: SetupAgentsOptions): SetupAgentsResult;
253
+
254
+ export { AGENTS_MD_BEGIN, AGENTS_MD_END, AGENT_TARGETS, DEFAULT_MCP_SERVER, MANAGED_MARKER, MCP_SERVER_NAME, createLogger, detectAgentTargets, execPromise, findInstalledPackage, findProjectPackage, logger, printBanner, readAgentDocs, readPackageVersion, redactError, redactSecrets, setupAgents };
255
+ export type { AgentDocs, AgentTarget, ExecPromiseOptions, LogLevel, Logger, LoggerOptions, SetupAgentsAction, SetupAgentsChange, SetupAgentsOptions, SetupAgentsResult };
package/dist/index.mjs CHANGED
@@ -3,6 +3,9 @@ import process$1 from 'node:process';
3
3
  import { blueBright } from 'colorette';
4
4
  import { createConsola } from 'consola';
5
5
  import figlet from 'figlet';
6
+ import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
7
+ import { join, dirname } from 'node:path';
8
+ import { parse, applyEdits, modify } from 'jsonc-parser';
6
9
 
7
10
  const LogLevelMap = {
8
11
  silent: Number.NEGATIVE_INFINITY,
@@ -180,4 +183,258 @@ function printBanner({
180
183
  logger.break();
181
184
  }
182
185
 
183
- export { createLogger, execPromise, logger, printBanner, redactError, redactSecrets };
186
+ const AGENT_TARGETS = ["claude", "agents-md", "cursor", "vscode"];
187
+ const MANAGED_MARKER = "Managed by maz-ui";
188
+ const AGENTS_MD_BEGIN = "<!-- BEGIN:maz-ui -->";
189
+ const AGENTS_MD_END = "<!-- END:maz-ui -->";
190
+ const MCP_SERVER_NAME = "maz-ui";
191
+ const DEFAULT_MCP_SERVER = { command: "npx", args: ["-y", "@maz-ui/mcp@latest"] };
192
+ const CLAUDE_RULE_FILE = ".claude/rules/maz-ui.md";
193
+ const CLAUDE_MEMORY_FILES = ["CLAUDE.md", ".claude/CLAUDE.md", "CLAUDE.local.md"];
194
+ function withVersion(content, version) {
195
+ return content.replace(/^(#{1,2} .+)\n/, `$1
196
+
197
+ > maz-ui ${version} is installed: these rules and the docs in \`node_modules/maz-ui/docs\` match this version.
198
+ `);
199
+ }
200
+ function managedHeader(version) {
201
+ return `<!-- ${MANAGED_MARKER} ${version}: generated by \`npx @maz-ui/mcp init\` (or the \`mazUi.agents\` Nuxt option). Do not edit, your changes would be overwritten: write your own rules elsewhere. -->`;
202
+ }
203
+ function detectAgentTargets(rootDir) {
204
+ const has = (path) => existsSync(join(rootDir, path));
205
+ const targets = /* @__PURE__ */ new Set();
206
+ if (has(".claude") || CLAUDE_MEMORY_FILES.some(has) || has(".mcp.json"))
207
+ targets.add("claude");
208
+ if (has(".cursor") || has(".cursorrules"))
209
+ targets.add("cursor");
210
+ if (has(".vscode/mcp.json") || has(".github/copilot-instructions.md") || has(".github/instructions"))
211
+ targets.add("vscode");
212
+ if (has("AGENTS.md") || targets.has("cursor") || targets.has("vscode") || has(".codex") || has(".windsurf") || has(".devin") || has(".windsurfrules") || has("GEMINI.md"))
213
+ targets.add("agents-md");
214
+ return AGENT_TARGETS.filter((target) => targets.has(target));
215
+ }
216
+ function findInstalledPackage(fromDir, name) {
217
+ let directory = fromDir;
218
+ for (; ; ) {
219
+ const candidate = join(directory, "node_modules", name);
220
+ if (existsSync(join(candidate, "package.json")))
221
+ return candidate;
222
+ const parent = dirname(directory);
223
+ if (parent === directory)
224
+ return void 0;
225
+ directory = parent;
226
+ }
227
+ }
228
+ function readPackageVersion(packageDir) {
229
+ const file = join(packageDir, "package.json");
230
+ return existsSync(file) ? JSON.parse(readFileSync(file, "utf8")).version : void 0;
231
+ }
232
+ function findProjectPackage(rootDir, name) {
233
+ const bases = [rootDir];
234
+ for (const folder of ["apps", "packages"]) {
235
+ const root = join(rootDir, folder);
236
+ if (existsSync(root)) {
237
+ for (const entry of readdirSync(root, { withFileTypes: true })) {
238
+ if (entry.isDirectory())
239
+ bases.push(join(root, entry.name));
240
+ }
241
+ }
242
+ }
243
+ return bases.map((base) => join(base, "node_modules", name)).find((candidate) => existsSync(join(candidate, "package.json"))) ?? findInstalledPackage(rootDir, name);
244
+ }
245
+ function readAgentDocs(rootDir, docsDir) {
246
+ let directory = docsDir;
247
+ if (!directory) {
248
+ const packageDir = findProjectPackage(rootDir, "maz-ui");
249
+ if (!packageDir)
250
+ throw new Error(`maz-ui is not installed in ${rootDir}: install it first (\`npm install maz-ui\`).`);
251
+ directory = join(packageDir, "docs");
252
+ }
253
+ const manifestFile = join(directory, "manifest.json");
254
+ const claudeRuleFile = join(directory, "agents/claude-rule.md");
255
+ const agentsMdFile = join(directory, "agents/agents-md.md");
256
+ if (!existsSync(manifestFile) || !existsSync(claudeRuleFile) || !existsSync(agentsMdFile)) {
257
+ throw new Error(`The installed maz-ui does not ship the agent docs (${directory}): upgrade maz-ui to the latest version.`);
258
+ }
259
+ const packageVersion = readPackageVersion(dirname(directory));
260
+ return {
261
+ directory,
262
+ version: packageVersion ?? JSON.parse(readFileSync(manifestFile, "utf8")).version,
263
+ claudeRule: readFileSync(claudeRuleFile, "utf8").trim(),
264
+ agentsMdSection: readFileSync(agentsMdFile, "utf8").trim()
265
+ };
266
+ }
267
+ class ChangeSet {
268
+ constructor(rootDir, dryRun) {
269
+ this.rootDir = rootDir;
270
+ this.dryRun = dryRun;
271
+ }
272
+ changes = [];
273
+ absolute(file) {
274
+ return join(this.rootDir, file);
275
+ }
276
+ read(file) {
277
+ const path = this.absolute(file);
278
+ return existsSync(path) ? readFileSync(path, "utf8") : void 0;
279
+ }
280
+ write(file, content, current) {
281
+ if (current === content) {
282
+ this.changes.push({ file, action: "unchanged" });
283
+ return;
284
+ }
285
+ this.changes.push({ file, action: current === void 0 ? "create" : "update" });
286
+ if (!this.dryRun) {
287
+ mkdirSync(dirname(this.absolute(file)), { recursive: true });
288
+ writeFileSync(this.absolute(file), content);
289
+ }
290
+ }
291
+ delete(file) {
292
+ this.changes.push({ file, action: "remove" });
293
+ if (!this.dryRun)
294
+ rmSync(this.absolute(file), { force: true });
295
+ }
296
+ skip(file, reason) {
297
+ this.changes.push({ file, action: "skip", reason });
298
+ }
299
+ unchanged(file, reason) {
300
+ this.changes.push({ file, action: "unchanged", reason });
301
+ }
302
+ }
303
+ function isOwned(content) {
304
+ return content === void 0 || content.includes(MANAGED_MARKER);
305
+ }
306
+ function syncOwnedFile(changes, file, content) {
307
+ const current = changes.read(file);
308
+ if (!isOwned(current)) {
309
+ changes.skip(file, "file exists and was not generated by maz-ui: left untouched");
310
+ return;
311
+ }
312
+ if (content === void 0) {
313
+ if (current !== void 0)
314
+ changes.delete(file);
315
+ return;
316
+ }
317
+ changes.write(file, content, current);
318
+ }
319
+ function syncAgentsMd(changes, section) {
320
+ const file = "AGENTS.md";
321
+ const current = changes.read(file);
322
+ const begin = current?.indexOf(AGENTS_MD_BEGIN) ?? -1;
323
+ const end = current?.indexOf(AGENTS_MD_END) ?? -1;
324
+ const hasBlock = begin !== -1 && end > begin;
325
+ if (section === void 0) {
326
+ if (!current || !hasBlock)
327
+ return;
328
+ const remaining = `${current.slice(0, begin)}${current.slice(end + AGENTS_MD_END.length)}`.replace(/\n{3,}/g, "\n\n").trim();
329
+ if (remaining)
330
+ changes.write(file, `${remaining}
331
+ `, current);
332
+ else
333
+ changes.delete(file);
334
+ return;
335
+ }
336
+ const block = `${AGENTS_MD_BEGIN}
337
+
338
+ ${section}
339
+
340
+ ${AGENTS_MD_END}`;
341
+ if (!current) {
342
+ changes.write(file, `${block}
343
+ `, current);
344
+ } else if (hasBlock) {
345
+ changes.write(file, `${current.slice(0, begin)}${block}${current.slice(end + AGENTS_MD_END.length)}`, current);
346
+ } else {
347
+ changes.write(file, `${current.trimEnd()}
348
+
349
+ ${block}
350
+ `, current);
351
+ }
352
+ }
353
+ const MCP_FILES = {
354
+ claude: { file: ".mcp.json", rootKey: "mcpServers", withType: true },
355
+ cursor: { file: ".cursor/mcp.json", rootKey: "mcpServers", withType: false },
356
+ vscode: { file: ".vscode/mcp.json", rootKey: "servers", withType: true }
357
+ };
358
+ function referencesMazUiMcp(server) {
359
+ const serialized = JSON.stringify(server);
360
+ return serialized.includes("@maz-ui/mcp") || serialized.includes("maz-ui-mcp");
361
+ }
362
+ function detectFormatting(content) {
363
+ const indent = /^( +|\t)"/m.exec(content)?.[1] ?? " ";
364
+ return { insertSpaces: !indent.includes(" "), tabSize: indent.includes(" ") ? 1 : indent.length, eol: content.includes("\r\n") ? "\r\n" : "\n" };
365
+ }
366
+ function isJsonObject(value) {
367
+ return typeof value === "object" && value !== null && !Array.isArray(value);
368
+ }
369
+ function syncMcpConfig(changes, config, server, remove) {
370
+ const current = changes.read(config.file);
371
+ const errors = [];
372
+ const parsed = current === void 0 ? {} : parse(current, errors, { allowTrailingComma: true });
373
+ if (errors.length > 0 || !isJsonObject(parsed) || parsed[config.rootKey] !== void 0 && !isJsonObject(parsed[config.rootKey])) {
374
+ changes.skip(config.file, "invalid JSON: left untouched");
375
+ return;
376
+ }
377
+ const servers = parsed[config.rootKey] ?? {};
378
+ const existing = Object.entries(servers).find(([, value2]) => referencesMazUiMcp(value2));
379
+ const base = current ?? "{}\n";
380
+ const formatting = detectFormatting(base);
381
+ if (remove) {
382
+ if (existing?.[0] === MCP_SERVER_NAME) {
383
+ const content2 = applyEdits(base, modify(base, [config.rootKey, MCP_SERVER_NAME], void 0, { formattingOptions: formatting }));
384
+ const remaining = parse(content2);
385
+ const isEmpty = Object.keys(remaining).length === 1 && Object.keys(remaining[config.rootKey]).length === 0;
386
+ if (isEmpty)
387
+ changes.delete(config.file);
388
+ else
389
+ changes.write(config.file, content2, current);
390
+ }
391
+ return;
392
+ }
393
+ if (existing) {
394
+ changes.unchanged(config.file, `maz-ui MCP server already registered as "${existing[0]}"`);
395
+ return;
396
+ }
397
+ if (servers[MCP_SERVER_NAME] !== void 0) {
398
+ changes.skip(config.file, `a "${MCP_SERVER_NAME}" server already exists with another command: left untouched`);
399
+ return;
400
+ }
401
+ const value = config.withType ? { type: "stdio", ...server } : { ...server };
402
+ const content = applyEdits(base, modify(base, [config.rootKey, MCP_SERVER_NAME], value, { formattingOptions: formatting }));
403
+ changes.write(config.file, content.endsWith("\n") ? content : `${content}
404
+ `, current);
405
+ }
406
+ function syncRules(changes, rootDir, targets, docs) {
407
+ const version = docs?.version ?? "";
408
+ const hasClaudeMemory = CLAUDE_MEMORY_FILES.some((file) => existsSync(join(rootDir, file)));
409
+ const claudeReadsAgentsMd = targets.includes("agents-md") && !hasClaudeMemory;
410
+ if (targets.includes("claude")) {
411
+ const rule = docs && !claudeReadsAgentsMd ? `${managedHeader(version)}
412
+
413
+ ${withVersion(docs.claudeRule, version)}
414
+ ` : void 0;
415
+ syncOwnedFile(changes, CLAUDE_RULE_FILE, rule);
416
+ }
417
+ if (targets.includes("agents-md"))
418
+ syncAgentsMd(changes, docs ? `${managedHeader(version)}
419
+
420
+ ${withVersion(docs.agentsMdSection, version)}` : void 0);
421
+ }
422
+ function setupAgents(options) {
423
+ const { rootDir, rules = true, mcp = true, dryRun = false, remove = false } = options;
424
+ const targets = options.targets ?? detectAgentTargets(rootDir);
425
+ const docs = remove || !rules ? void 0 : readAgentDocs(rootDir, options.docsDir);
426
+ const version = docs?.version ?? "";
427
+ const changes = new ChangeSet(rootDir, dryRun);
428
+ const server = options.mcpServer ?? DEFAULT_MCP_SERVER;
429
+ if (rules || remove)
430
+ syncRules(changes, rootDir, targets, docs);
431
+ if (mcp || remove) {
432
+ for (const target of ["claude", "cursor", "vscode"]) {
433
+ if (targets.includes(target))
434
+ syncMcpConfig(changes, MCP_FILES[target], server, remove);
435
+ }
436
+ }
437
+ return { targets, version, changes: changes.changes };
438
+ }
439
+
440
+ export { AGENTS_MD_BEGIN, AGENTS_MD_END, AGENT_TARGETS, DEFAULT_MCP_SERVER, MANAGED_MARKER, MCP_SERVER_NAME, createLogger, detectAgentTargets, execPromise, findInstalledPackage, findProjectPackage, logger, printBanner, readAgentDocs, readPackageVersion, redactError, redactSecrets, setupAgents };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maz-ui/node",
3
3
  "type": "module",
4
- "version": "5.0.0",
4
+ "version": "5.1.0-beta.1",
5
5
  "description": "Node utilities for Maz-UI library",
6
6
  "author": "Louis Mazel <me@loicmazuel.com>",
7
7
  "license": "MIT",
@@ -15,7 +15,9 @@
15
15
  "utilities",
16
16
  "maz-ui",
17
17
  "promise",
18
- "logger"
18
+ "logger",
19
+ "ai",
20
+ "agents"
19
21
  ],
20
22
  "sideEffects": false,
21
23
  "publishConfig": {
@@ -42,7 +44,8 @@
42
44
  "dependencies": {
43
45
  "colorette": "^2.0.20",
44
46
  "consola": "^3.4.2",
45
- "figlet": "^1.12.0"
47
+ "figlet": "^1.12.0",
48
+ "jsonc-parser": "^3.3.1"
46
49
  },
47
50
  "devDependencies": {
48
51
  "unbuild": "^3.6.1"