@bearnie/mcp 0.1.3 → 0.3.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/dist/install.d.ts CHANGED
@@ -1,3 +1,17 @@
1
+ export interface ProjectConfig {
2
+ componentsDir: string;
3
+ utilsDir: string;
4
+ stylesDir: string;
5
+ /** Which color theme is installed ("default", "amber", ...). */
6
+ theme: string;
7
+ }
8
+ export declare const DEFAULT_PROJECT_CONFIG: ProjectConfig;
9
+ /** Registry entry name for a theme: "default" -> styles, "amber" -> styles-amber. */
10
+ export declare function themeEntryName(theme: string): string;
11
+ /** True for the styles/styles-* entries, which all install the same CSS file. */
12
+ export declare function isThemeEntry(name: string): boolean;
13
+ /** Reads bearnie.json from the project root, falling back to defaults. */
14
+ export declare function loadProjectConfig(projectRoot: string): Promise<ProjectConfig>;
1
15
  export interface ComponentFile {
2
16
  name: string;
3
17
  path: string;
@@ -23,12 +37,47 @@ export interface RegistryIndex {
23
37
  description: string;
24
38
  category: string;
25
39
  }>;
40
+ utilities?: Array<{
41
+ name: string;
42
+ description: string;
43
+ }>;
44
+ themes?: string[];
45
+ themeBases?: string[];
46
+ themeAccents?: string[];
26
47
  }
48
+ export type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
49
+ /** Detects the project's package manager from its lockfile. */
50
+ export declare function detectPackageManager(projectRoot: string): PackageManager;
51
+ /** The install command for the given package manager, e.g. `npm install`. */
52
+ export declare function installCommandFor(pm: PackageManager): {
53
+ command: string;
54
+ args: string[];
55
+ };
27
56
  export declare function fetchComponent(name: string): Promise<ComponentRegistry | null>;
28
57
  export declare function fetchIndex(): Promise<RegistryIndex | null>;
29
- export declare function resolveInstallPath(projectRoot: string, file: ComponentFile, registryItem: ComponentRegistry): string;
58
+ export declare function resolveInstallPath(projectRoot: string, file: ComponentFile, registryItem: ComponentRegistry, config?: ProjectConfig): string;
30
59
  export declare function resolveComponentDependencies(names: string[], resolved?: Set<string>): Promise<string[]>;
31
60
  export declare function installComponents(projectRoot: string, names: string[]): Promise<InstallResult>;
61
+ /**
62
+ * Installs npm dependencies that are not already present in the project's
63
+ * package.json. Returns the packages actually installed, or an error message.
64
+ */
65
+ export declare function installNpmDependencies(projectRoot: string, dependencies: string[]): Promise<{
66
+ installed: string[];
67
+ error?: string;
68
+ }>;
69
+ export type InstalledStatus = "up-to-date" | "modified" | "incomplete";
70
+ export interface InstalledComponent {
71
+ name: string;
72
+ type: string;
73
+ status: InstalledStatus;
74
+ changedFiles: string[];
75
+ }
76
+ /**
77
+ * Scans the project for installed registry entries and compares each file
78
+ * against the registry version.
79
+ */
80
+ export declare function listInstalledComponents(projectRoot: string): Promise<InstalledComponent[] | null>;
32
81
  export declare function toPascalCase(name: string): string;
33
82
  export declare function getUsageExample(component: ComponentRegistry): string;
34
83
  //# sourceMappingURL=install.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAUA,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,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,KAAK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DtC;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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bearnie/mcp",
3
- "version": "0.1.3",
3
+ "version": "0.3.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",
@@ -18,17 +18,20 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@modelcontextprotocol/sdk": "^1.0.0",
21
- "node-fetch": "^3.3.2",
22
- "fs-extra": "^11.2.0"
21
+ "fs-extra": "^11.2.0",
22
+ "zod": "^4.0.0"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
23
26
  },
24
27
  "devDependencies": {
25
28
  "@types/fs-extra": "^11.0.4",
26
- "@types/node": "^20.14.9",
29
+ "@types/node": "^22.10.0",
27
30
  "tsup": "^8.1.0",
28
31
  "typescript": "^5.7.3"
29
32
  },
30
33
  "engines": {
31
- "node": ">=18"
34
+ "node": ">=22.12.0"
32
35
  },
33
36
  "author": "Michael Andreuzza",
34
37
  "repository": {
@@ -36,6 +39,10 @@
36
39
  "url": "https://github.com/michael-andreuzza/bearnie.git",
37
40
  "directory": "packages/mcp"
38
41
  },
42
+ "homepage": "https://bearnie.dev",
43
+ "bugs": {
44
+ "url": "https://github.com/michael-andreuzza/bearnie/issues"
45
+ },
39
46
  "keywords": [
40
47
  "mcp",
41
48
  "model-context-protocol",