@bearnie/mcp 0.1.2 → 0.2.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.
@@ -0,0 +1,74 @@
1
+ export interface ProjectConfig {
2
+ componentsDir: string;
3
+ utilsDir: string;
4
+ stylesDir: string;
5
+ }
6
+ export declare const DEFAULT_PROJECT_CONFIG: ProjectConfig;
7
+ /** Reads bearnie.json from the project root, falling back to defaults. */
8
+ export declare function loadProjectConfig(projectRoot: string): Promise<ProjectConfig>;
9
+ export interface ComponentFile {
10
+ name: string;
11
+ path: string;
12
+ content: string;
13
+ }
14
+ export interface ComponentRegistry {
15
+ name: string;
16
+ type?: "utility" | "component" | "styles";
17
+ description: string;
18
+ category?: string;
19
+ files: ComponentFile[];
20
+ dependencies?: string[];
21
+ registryDependencies?: string[];
22
+ }
23
+ export interface InstallResult {
24
+ installed: string[];
25
+ npmDependencies: string[];
26
+ errors: string[];
27
+ }
28
+ export interface RegistryIndex {
29
+ components: Array<{
30
+ name: string;
31
+ description: string;
32
+ category: string;
33
+ }>;
34
+ utilities?: Array<{
35
+ name: string;
36
+ description: string;
37
+ }>;
38
+ }
39
+ export type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
40
+ /** Detects the project's package manager from its lockfile. */
41
+ export declare function detectPackageManager(projectRoot: string): PackageManager;
42
+ /** The install command for the given package manager, e.g. `npm install`. */
43
+ export declare function installCommandFor(pm: PackageManager): {
44
+ command: string;
45
+ args: string[];
46
+ };
47
+ export declare function fetchComponent(name: string): Promise<ComponentRegistry | null>;
48
+ export declare function fetchIndex(): Promise<RegistryIndex | null>;
49
+ export declare function resolveInstallPath(projectRoot: string, file: ComponentFile, registryItem: ComponentRegistry, config?: ProjectConfig): string;
50
+ export declare function resolveComponentDependencies(names: string[], resolved?: Set<string>): Promise<string[]>;
51
+ export declare function installComponents(projectRoot: string, names: string[]): Promise<InstallResult>;
52
+ /**
53
+ * Installs npm dependencies that are not already present in the project's
54
+ * package.json. Returns the packages actually installed, or an error message.
55
+ */
56
+ export declare function installNpmDependencies(projectRoot: string, dependencies: string[]): Promise<{
57
+ installed: string[];
58
+ error?: string;
59
+ }>;
60
+ export type InstalledStatus = "up-to-date" | "modified" | "incomplete";
61
+ export interface InstalledComponent {
62
+ name: string;
63
+ type: string;
64
+ status: InstalledStatus;
65
+ changedFiles: string[];
66
+ }
67
+ /**
68
+ * Scans the project for installed registry entries and compares each file
69
+ * against the registry version.
70
+ */
71
+ export declare function listInstalledComponents(projectRoot: string): Promise<InstalledComponent[] | null>;
72
+ export declare function toPascalCase(name: string): string;
73
+ export declare function getUsageExample(component: ComponentRegistry): string;
74
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAIpC,CAAC;AAEF,0EAA0E;AAC1E,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,CAAC,CAWxB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,MAAM,WA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AAE,GACd,OAAO,CAAC,aAAa,CAAC,CAwBxB;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAoClD;AAED,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,CAgDtC;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,iBAAiB,GAAG,MAAM,CA8BpE"}
package/package.json CHANGED
@@ -1,33 +1,37 @@
1
1
  {
2
2
  "name": "@bearnie/mcp",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "MCP server for Bearnie UI components - enables AI assistants to add components to your project",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "bin": {
8
8
  "bearnie-mcp": "dist/index.js"
9
9
  },
10
+ "types": "dist/index.d.ts",
10
11
  "files": [
11
12
  "dist"
12
13
  ],
13
14
  "scripts": {
14
- "build": "tsup src/index.ts --format esm --clean",
15
+ "build": "tsup src/index.ts --format esm --clean && tsc --emitDeclarationOnly",
15
16
  "dev": "tsup src/index.ts --format esm --watch",
16
17
  "typecheck": "tsc --noEmit"
17
18
  },
18
19
  "dependencies": {
19
20
  "@modelcontextprotocol/sdk": "^1.0.0",
20
- "node-fetch": "^3.3.2",
21
- "fs-extra": "^11.2.0"
21
+ "fs-extra": "^11.2.0",
22
+ "zod": "^4.0.0"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
22
26
  },
23
27
  "devDependencies": {
24
28
  "@types/fs-extra": "^11.0.4",
25
- "@types/node": "^20.14.9",
29
+ "@types/node": "^22.10.0",
26
30
  "tsup": "^8.1.0",
27
31
  "typescript": "^5.7.3"
28
32
  },
29
33
  "engines": {
30
- "node": ">=18"
34
+ "node": ">=22.12.0"
31
35
  },
32
36
  "author": "Michael Andreuzza",
33
37
  "repository": {
@@ -35,6 +39,10 @@
35
39
  "url": "https://github.com/michael-andreuzza/bearnie.git",
36
40
  "directory": "packages/mcp"
37
41
  },
42
+ "homepage": "https://bearnie.dev",
43
+ "bugs": {
44
+ "url": "https://github.com/michael-andreuzza/bearnie/issues"
45
+ },
38
46
  "keywords": [
39
47
  "mcp",
40
48
  "model-context-protocol",