@maz-ui/mcp 5.1.1 → 5.2.0-beta.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 +9 -2
- package/dist/chunks/files.mjs +70 -0
- package/dist/chunks/index.mjs +28535 -0
- package/dist/chunks/prompt.mjs +280 -0
- package/dist/chunks/theme.mjs +14789 -0
- package/dist/cli.mjs +9 -11
- package/dist/index.d.mts +90 -5
- package/dist/index.d.ts +90 -5
- package/dist/index.mjs +13 -11
- package/dist/shared/mcp.Ccxm-Aoc.mjs +3312 -0
- package/dist/shared/mcp.D3_Fk0U3.mjs +34563 -0
- package/docs/agents/agents-md.md +32 -17
- package/docs/agents/claude-rule.md +32 -17
- package/docs/components/maz-alert.md +1 -1
- package/docs/components/maz-bottom-sheet.md +1 -1
- package/docs/components/maz-btn.md +3 -3
- package/docs/components/maz-container.md +2 -2
- package/docs/components/maz-dropdown.md +1 -1
- package/docs/components/maz-dropzone.md +1 -1
- package/docs/components/maz-icon.md +2 -2
- package/docs/components/maz-input.md +2 -2
- package/docs/components/maz-link.md +2 -2
- package/docs/components/maz-select-country.md +1 -1
- package/docs/components/maz-sidebar-menu-button.md +1 -1
- package/docs/components/maz-sidebar-menu-sub.md +1 -1
- package/docs/components/maz-sidebar.md +2 -2
- package/docs/ecosystem/icons/index.md +7 -4
- package/docs/ecosystem/mcp.md +47 -2
- package/docs/ecosystem/node/setup-agents.md +76 -3
- package/docs/guide/ai-agents.md +51 -17
- package/docs/manifest.json +1 -1
- package/docs/rules.md +32 -17
- package/package.json +28 -12
- package/dist/shared/mcp.cBFLVChV.mjs +0 -3002
package/dist/cli.mjs
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import 'node:buffer';
|
|
2
2
|
import 'node:path';
|
|
3
3
|
import 'node:util';
|
|
4
|
-
|
|
5
|
-
import '
|
|
6
|
-
|
|
4
|
+
export { H as HELP, m as main, r as runCli, j as runInit, k as runReview } from './shared/mcp.D3_Fk0U3.mjs';
|
|
5
|
+
import 'node:child_process';
|
|
6
|
+
import 'node:process';
|
|
7
|
+
import 'tty';
|
|
8
|
+
import 'node:tty';
|
|
9
|
+
import 'fs';
|
|
10
|
+
import 'path';
|
|
11
|
+
import 'url';
|
|
12
|
+
import 'node:crypto';
|
|
7
13
|
import 'node:fs';
|
|
8
14
|
import 'node:url';
|
|
9
|
-
import 'zod';
|
|
10
|
-
import 'minisearch';
|
|
11
|
-
import '@vue/compiler-dom';
|
|
12
|
-
import 'tinyglobby';
|
|
13
|
-
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
14
|
-
import '@modelcontextprotocol/sdk/server/stdio.js';
|
|
15
|
-
import 'node:child_process';
|
|
16
|
-
import '@babel/parser';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { main, runCli } from './cli.mjs';
|
|
2
2
|
import { z, ZodRawShape } from 'zod';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
-
export { AgentTarget, SetupAgentsOptions, SetupAgentsResult, setupAgents } from '@maz-ui/node';
|
|
5
4
|
|
|
6
5
|
declare const docCategories: readonly ["guide", "component", "composable", "directive", "plugin", "ecosystem", "util", "node", "reference"];
|
|
7
6
|
type DocCategory = typeof docCategories[number];
|
|
@@ -273,7 +272,8 @@ declare function searchIcons(names: Iterable<string>, query: string, limit?: num
|
|
|
273
272
|
|
|
274
273
|
interface ServerContext {
|
|
275
274
|
knowledge: Knowledge;
|
|
276
|
-
search:
|
|
275
|
+
/** Search index, built on the first search: the server answers `initialize` without reading the docs */
|
|
276
|
+
readonly search: DocSearch;
|
|
277
277
|
/** Directory used to resolve relative file paths (review_code) */
|
|
278
278
|
cwd: string;
|
|
279
279
|
}
|
|
@@ -285,7 +285,7 @@ declare function createContext(options?: CreateContextOptions): ServerContext;
|
|
|
285
285
|
declare function buildInstructions(context: ServerContext): string;
|
|
286
286
|
|
|
287
287
|
type Severity = 'error' | 'warning' | 'info';
|
|
288
|
-
type RuleId = 'unknown-component' | 'unknown-prop' | 'invalid-prop-value' | 'boolean-prop-string' | 'unknown-model' | 'unknown-event' | 'unknown-slot' | 'unknown-icon' | 'prefer-maz-component' | 'inline-svg' | 'internal-prefix' | 'theme-colors' | 'hardcoded-color' | 'tailwind-v3' | 'root-import' | 'internal-import' | 'prefer-ecosystem' | 'manual-dark-mode' | 'prefer-utils' | 'nuxt-auto-import' | 'missing-reference';
|
|
288
|
+
type RuleId = 'unknown-component' | 'unknown-prop' | 'invalid-prop-value' | 'boolean-prop-string' | 'unknown-model' | 'unknown-event' | 'unknown-slot' | 'unknown-icon' | 'prefer-maz-component' | 'inline-svg' | 'icon-button-label' | 'internal-prefix' | 'theme-colors' | 'hardcoded-color' | 'tailwind-v3' | 'root-import' | 'internal-import' | 'prefer-ecosystem' | 'manual-dark-mode' | 'prefer-utils' | 'nuxt-auto-import' | 'missing-reference';
|
|
289
289
|
interface Finding {
|
|
290
290
|
rule: RuleId;
|
|
291
291
|
severity: Severity;
|
|
@@ -341,5 +341,90 @@ declare function createMazUiMcpServer(options?: CreateContextOptions): {
|
|
|
341
341
|
};
|
|
342
342
|
declare function startStdioServer(options?: CreateContextOptions): Promise<McpServer>;
|
|
343
343
|
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
/**
|
|
345
|
+
* AI coding agents supported by `setupAgents`.
|
|
346
|
+
*
|
|
347
|
+
* - `claude`: Claude Code rule (`.claude/rules/<tool>.md`) and MCP server (`.mcp.json`)
|
|
348
|
+
* - `agents-md`: section in `AGENTS.md` (Codex, Cursor, Copilot, Windsurf, Zed, Gemini...)
|
|
349
|
+
* - `cursor`: MCP server in `.cursor/mcp.json` (rules come from `AGENTS.md`)
|
|
350
|
+
* - `vscode`: MCP server in `.vscode/mcp.json` for GitHub Copilot (rules come from `AGENTS.md`)
|
|
351
|
+
*/
|
|
352
|
+
type AgentTarget = 'claude' | 'agents-md' | 'cursor' | 'vscode';
|
|
353
|
+
interface SetupAgentsOptions {
|
|
354
|
+
/** Root of the project (where `AGENTS.md`, `.claude/`, `.mcp.json` live) */
|
|
355
|
+
rootDir: string;
|
|
356
|
+
/** Agents to configure. Default: the agents detected in the project */
|
|
357
|
+
targets?: AgentTarget[];
|
|
358
|
+
/** Write the rules of the tool (Claude Code rule, `AGENTS.md` section). Default `true` */
|
|
359
|
+
rules?: boolean;
|
|
360
|
+
/** Register the MCP server of the tool. Default `true` */
|
|
361
|
+
mcp?: boolean;
|
|
362
|
+
/** Compute the changes without writing anything */
|
|
363
|
+
dryRun?: boolean;
|
|
364
|
+
/** Remove everything `setupAgents` added */
|
|
365
|
+
remove?: boolean;
|
|
366
|
+
/** Folder of the maz-ui agent docs. Default: `docs/` of the maz-ui package installed in `rootDir` */
|
|
367
|
+
docsDir?: string;
|
|
368
|
+
/** Command used to start the MCP server. Default: `mcpServerCommand(rootDir, mcpVersion, tool)` */
|
|
369
|
+
mcpServer?: McpServerCommand;
|
|
370
|
+
/** Version of the MCP package pinned in the `npx -y` command, when the project does not install it. Default `latest` */
|
|
371
|
+
mcpVersion?: string;
|
|
372
|
+
/** Tool whose agents are configured. Default: maz-ui (`MAZ_UI_AGENTS_TOOL`) */
|
|
373
|
+
tool?: AgentsTool;
|
|
374
|
+
/** Rules of the tool, required with another `tool` than maz-ui. Default: the maz-ui agent docs of `docsDir` */
|
|
375
|
+
agentDocs?: AgentDocs;
|
|
376
|
+
}
|
|
377
|
+
interface McpServerCommand {
|
|
378
|
+
command: string;
|
|
379
|
+
args: string[];
|
|
380
|
+
}
|
|
381
|
+
type SetupAgentsAction = 'create' | 'update' | 'remove' | 'unchanged' | 'skip';
|
|
382
|
+
interface SetupAgentsChange {
|
|
383
|
+
/** Path relative to `rootDir` */
|
|
384
|
+
file: string;
|
|
385
|
+
action: SetupAgentsAction;
|
|
386
|
+
reason?: string;
|
|
387
|
+
}
|
|
388
|
+
interface SetupAgentsResult {
|
|
389
|
+
targets: AgentTarget[];
|
|
390
|
+
version: string;
|
|
391
|
+
changes: SetupAgentsChange[];
|
|
392
|
+
/** Command registered in the MCP config files */
|
|
393
|
+
mcpServer: McpServerCommand;
|
|
394
|
+
/** `false` when the server runs through `npx -y` because the project does not install the MCP package */
|
|
395
|
+
localMcpServer: boolean;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* A tool whose AI agents are configured by `setupAgents`: maz-ui by default,
|
|
399
|
+
* or another package that ships its own MCP server and rules.
|
|
400
|
+
*/
|
|
401
|
+
interface AgentsTool {
|
|
402
|
+
/** Name of the tool: key of its MCP server, `.claude/rules/<name>.md` and markers of the generated content */
|
|
403
|
+
name: string;
|
|
404
|
+
/** Package that ships the MCP server */
|
|
405
|
+
mcpPackage: string;
|
|
406
|
+
/** Bin of `mcpPackage` that starts the MCP server */
|
|
407
|
+
mcpBin: string;
|
|
408
|
+
/** Arguments of `mcpBin` that start the MCP server (e.g. `['mcp']`). Default `[]` */
|
|
409
|
+
mcpArgs?: string[];
|
|
410
|
+
/** What generates the rules, written in their header (markdown, e.g. `` `npx relizy mcp init` ``) */
|
|
411
|
+
generatedBy: string;
|
|
412
|
+
/** Line written under the title of the rules. Default: `> <name> <version> is installed: these rules match this version.` */
|
|
413
|
+
versionNote?: (version: string) => string;
|
|
414
|
+
}
|
|
415
|
+
interface AgentDocs {
|
|
416
|
+
directory: string;
|
|
417
|
+
version: string;
|
|
418
|
+
claudeRule: string;
|
|
419
|
+
agentsMdSection: string;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Configures the AI coding agents of a project to use a tool, maz-ui by
|
|
423
|
+
* default: rules (version matched with the installed tool) and its MCP server.
|
|
424
|
+
* Idempotent and conservative: it only writes files it owns, a delimited
|
|
425
|
+
* section of `AGENTS.md` and its own entry of the MCP config files.
|
|
426
|
+
*/
|
|
427
|
+
declare function setupAgents(options: SetupAgentsOptions): SetupAgentsResult;
|
|
428
|
+
|
|
429
|
+
export { DocSearch, Knowledge, TOOLS, buildInstructions, countBySeverity, createContext, createMazUiMcpServer, filterBySeverity, findProjectMazUi, formatFindings, loadKnowledge, reviewCode, reviewFiles, searchIcons, setupAgents, startStdioServer };
|
|
430
|
+
export type { AgentTarget, ComponentApi, CreateContextOptions, DocCategory, DocEntry, Finding, Framework, KnowledgeSource, LoadKnowledgeOptions, Manifest, ReviewOptions, RuleId, ServerContext, SetupAgentsOptions, SetupAgentsResult, Severity };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { main, runCli } from './cli.js';
|
|
2
2
|
import { z, ZodRawShape } from 'zod';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
-
export { AgentTarget, SetupAgentsOptions, SetupAgentsResult, setupAgents } from '@maz-ui/node';
|
|
5
4
|
|
|
6
5
|
declare const docCategories: readonly ["guide", "component", "composable", "directive", "plugin", "ecosystem", "util", "node", "reference"];
|
|
7
6
|
type DocCategory = typeof docCategories[number];
|
|
@@ -273,7 +272,8 @@ declare function searchIcons(names: Iterable<string>, query: string, limit?: num
|
|
|
273
272
|
|
|
274
273
|
interface ServerContext {
|
|
275
274
|
knowledge: Knowledge;
|
|
276
|
-
search:
|
|
275
|
+
/** Search index, built on the first search: the server answers `initialize` without reading the docs */
|
|
276
|
+
readonly search: DocSearch;
|
|
277
277
|
/** Directory used to resolve relative file paths (review_code) */
|
|
278
278
|
cwd: string;
|
|
279
279
|
}
|
|
@@ -285,7 +285,7 @@ declare function createContext(options?: CreateContextOptions): ServerContext;
|
|
|
285
285
|
declare function buildInstructions(context: ServerContext): string;
|
|
286
286
|
|
|
287
287
|
type Severity = 'error' | 'warning' | 'info';
|
|
288
|
-
type RuleId = 'unknown-component' | 'unknown-prop' | 'invalid-prop-value' | 'boolean-prop-string' | 'unknown-model' | 'unknown-event' | 'unknown-slot' | 'unknown-icon' | 'prefer-maz-component' | 'inline-svg' | 'internal-prefix' | 'theme-colors' | 'hardcoded-color' | 'tailwind-v3' | 'root-import' | 'internal-import' | 'prefer-ecosystem' | 'manual-dark-mode' | 'prefer-utils' | 'nuxt-auto-import' | 'missing-reference';
|
|
288
|
+
type RuleId = 'unknown-component' | 'unknown-prop' | 'invalid-prop-value' | 'boolean-prop-string' | 'unknown-model' | 'unknown-event' | 'unknown-slot' | 'unknown-icon' | 'prefer-maz-component' | 'inline-svg' | 'icon-button-label' | 'internal-prefix' | 'theme-colors' | 'hardcoded-color' | 'tailwind-v3' | 'root-import' | 'internal-import' | 'prefer-ecosystem' | 'manual-dark-mode' | 'prefer-utils' | 'nuxt-auto-import' | 'missing-reference';
|
|
289
289
|
interface Finding {
|
|
290
290
|
rule: RuleId;
|
|
291
291
|
severity: Severity;
|
|
@@ -341,5 +341,90 @@ declare function createMazUiMcpServer(options?: CreateContextOptions): {
|
|
|
341
341
|
};
|
|
342
342
|
declare function startStdioServer(options?: CreateContextOptions): Promise<McpServer>;
|
|
343
343
|
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
/**
|
|
345
|
+
* AI coding agents supported by `setupAgents`.
|
|
346
|
+
*
|
|
347
|
+
* - `claude`: Claude Code rule (`.claude/rules/<tool>.md`) and MCP server (`.mcp.json`)
|
|
348
|
+
* - `agents-md`: section in `AGENTS.md` (Codex, Cursor, Copilot, Windsurf, Zed, Gemini...)
|
|
349
|
+
* - `cursor`: MCP server in `.cursor/mcp.json` (rules come from `AGENTS.md`)
|
|
350
|
+
* - `vscode`: MCP server in `.vscode/mcp.json` for GitHub Copilot (rules come from `AGENTS.md`)
|
|
351
|
+
*/
|
|
352
|
+
type AgentTarget = 'claude' | 'agents-md' | 'cursor' | 'vscode';
|
|
353
|
+
interface SetupAgentsOptions {
|
|
354
|
+
/** Root of the project (where `AGENTS.md`, `.claude/`, `.mcp.json` live) */
|
|
355
|
+
rootDir: string;
|
|
356
|
+
/** Agents to configure. Default: the agents detected in the project */
|
|
357
|
+
targets?: AgentTarget[];
|
|
358
|
+
/** Write the rules of the tool (Claude Code rule, `AGENTS.md` section). Default `true` */
|
|
359
|
+
rules?: boolean;
|
|
360
|
+
/** Register the MCP server of the tool. Default `true` */
|
|
361
|
+
mcp?: boolean;
|
|
362
|
+
/** Compute the changes without writing anything */
|
|
363
|
+
dryRun?: boolean;
|
|
364
|
+
/** Remove everything `setupAgents` added */
|
|
365
|
+
remove?: boolean;
|
|
366
|
+
/** Folder of the maz-ui agent docs. Default: `docs/` of the maz-ui package installed in `rootDir` */
|
|
367
|
+
docsDir?: string;
|
|
368
|
+
/** Command used to start the MCP server. Default: `mcpServerCommand(rootDir, mcpVersion, tool)` */
|
|
369
|
+
mcpServer?: McpServerCommand;
|
|
370
|
+
/** Version of the MCP package pinned in the `npx -y` command, when the project does not install it. Default `latest` */
|
|
371
|
+
mcpVersion?: string;
|
|
372
|
+
/** Tool whose agents are configured. Default: maz-ui (`MAZ_UI_AGENTS_TOOL`) */
|
|
373
|
+
tool?: AgentsTool;
|
|
374
|
+
/** Rules of the tool, required with another `tool` than maz-ui. Default: the maz-ui agent docs of `docsDir` */
|
|
375
|
+
agentDocs?: AgentDocs;
|
|
376
|
+
}
|
|
377
|
+
interface McpServerCommand {
|
|
378
|
+
command: string;
|
|
379
|
+
args: string[];
|
|
380
|
+
}
|
|
381
|
+
type SetupAgentsAction = 'create' | 'update' | 'remove' | 'unchanged' | 'skip';
|
|
382
|
+
interface SetupAgentsChange {
|
|
383
|
+
/** Path relative to `rootDir` */
|
|
384
|
+
file: string;
|
|
385
|
+
action: SetupAgentsAction;
|
|
386
|
+
reason?: string;
|
|
387
|
+
}
|
|
388
|
+
interface SetupAgentsResult {
|
|
389
|
+
targets: AgentTarget[];
|
|
390
|
+
version: string;
|
|
391
|
+
changes: SetupAgentsChange[];
|
|
392
|
+
/** Command registered in the MCP config files */
|
|
393
|
+
mcpServer: McpServerCommand;
|
|
394
|
+
/** `false` when the server runs through `npx -y` because the project does not install the MCP package */
|
|
395
|
+
localMcpServer: boolean;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* A tool whose AI agents are configured by `setupAgents`: maz-ui by default,
|
|
399
|
+
* or another package that ships its own MCP server and rules.
|
|
400
|
+
*/
|
|
401
|
+
interface AgentsTool {
|
|
402
|
+
/** Name of the tool: key of its MCP server, `.claude/rules/<name>.md` and markers of the generated content */
|
|
403
|
+
name: string;
|
|
404
|
+
/** Package that ships the MCP server */
|
|
405
|
+
mcpPackage: string;
|
|
406
|
+
/** Bin of `mcpPackage` that starts the MCP server */
|
|
407
|
+
mcpBin: string;
|
|
408
|
+
/** Arguments of `mcpBin` that start the MCP server (e.g. `['mcp']`). Default `[]` */
|
|
409
|
+
mcpArgs?: string[];
|
|
410
|
+
/** What generates the rules, written in their header (markdown, e.g. `` `npx relizy mcp init` ``) */
|
|
411
|
+
generatedBy: string;
|
|
412
|
+
/** Line written under the title of the rules. Default: `> <name> <version> is installed: these rules match this version.` */
|
|
413
|
+
versionNote?: (version: string) => string;
|
|
414
|
+
}
|
|
415
|
+
interface AgentDocs {
|
|
416
|
+
directory: string;
|
|
417
|
+
version: string;
|
|
418
|
+
claudeRule: string;
|
|
419
|
+
agentsMdSection: string;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Configures the AI coding agents of a project to use a tool, maz-ui by
|
|
423
|
+
* default: rules (version matched with the installed tool) and its MCP server.
|
|
424
|
+
* Idempotent and conservative: it only writes files it owns, a delimited
|
|
425
|
+
* section of `AGENTS.md` and its own entry of the MCP config files.
|
|
426
|
+
*/
|
|
427
|
+
declare function setupAgents(options: SetupAgentsOptions): SetupAgentsResult;
|
|
428
|
+
|
|
429
|
+
export { DocSearch, Knowledge, TOOLS, buildInstructions, countBySeverity, createContext, createMazUiMcpServer, filterBySeverity, findProjectMazUi, formatFindings, loadKnowledge, reviewCode, reviewFiles, searchIcons, setupAgents, startStdioServer };
|
|
430
|
+
export type { AgentTarget, ComponentApi, CreateContextOptions, DocCategory, DocEntry, Finding, Framework, KnowledgeSource, LoadKnowledgeOptions, Manifest, ReviewOptions, RuleId, ServerContext, SetupAgentsOptions, SetupAgentsResult, Severity };
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
export { D as DocSearch, K as Knowledge, T as TOOLS, b as buildInstructions, c as
|
|
2
|
-
export {
|
|
1
|
+
export { D as DocSearch, K as Knowledge, T as TOOLS, b as buildInstructions, c as createContext, a as createMazUiMcpServer, f as findProjectMazUi, l as loadKnowledge, m as main, r as runCli, s as searchIcons, d as setupAgents, e as startStdioServer } from './shared/mcp.D3_Fk0U3.mjs';
|
|
2
|
+
export { countBySeverity, filterBySeverity, formatFindings, reviewCode } from './chunks/index.mjs';
|
|
3
|
+
export { reviewFiles } from './chunks/files.mjs';
|
|
3
4
|
import 'node:buffer';
|
|
4
5
|
import 'node:path';
|
|
5
6
|
import 'node:util';
|
|
6
|
-
import '
|
|
7
|
+
import 'node:child_process';
|
|
8
|
+
import 'node:process';
|
|
9
|
+
import 'tty';
|
|
10
|
+
import 'node:tty';
|
|
11
|
+
import 'fs';
|
|
12
|
+
import 'path';
|
|
13
|
+
import 'url';
|
|
14
|
+
import 'node:crypto';
|
|
7
15
|
import 'node:fs';
|
|
8
16
|
import 'node:url';
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
import '@vue/compiler-dom';
|
|
12
|
-
import 'tinyglobby';
|
|
13
|
-
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
14
|
-
import '@modelcontextprotocol/sdk/server/stdio.js';
|
|
15
|
-
import 'node:child_process';
|
|
16
|
-
import '@babel/parser';
|
|
17
|
+
import './shared/mcp.Ccxm-Aoc.mjs';
|
|
18
|
+
import 'module';
|