@webspire/mcp 0.8.1 → 0.9.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.
@@ -1,5 +1,5 @@
1
1
  import { type SnippetSearchOptions } from './search.js';
2
- import type { Registry, SnippetEntry } from './types.js';
2
+ import type { FontsData, Registry, SnippetEntry } from './types.js';
3
3
  export type { Registry, SnippetEntry };
4
4
  export interface RegistryOptions {
5
5
  url?: string;
@@ -12,6 +12,10 @@ export interface RegistryOptions {
12
12
  * 3. Remote fetch from --registry-url or default URL
13
13
  */
14
14
  export declare function loadRegistry(options?: RegistryOptions): Promise<Registry>;
15
+ /**
16
+ * Load the bundled fonts.json shipped with this package.
17
+ */
18
+ export declare function loadFonts(): Promise<FontsData | null>;
15
19
  export type SearchOptions = SnippetSearchOptions;
16
20
  export declare function searchSnippets(registry: Registry, options: SearchOptions): SnippetEntry[];
17
21
  export declare function suggestSnippets(registry: Registry, problem: string): SnippetEntry[];
package/dist/registry.js CHANGED
@@ -52,6 +52,23 @@ export async function loadRegistry(options) {
52
52
  cache = { registry, loadedAt: Date.now() };
53
53
  return registry;
54
54
  }
55
+ /**
56
+ * Load the bundled fonts.json shipped with this package.
57
+ */
58
+ export async function loadFonts() {
59
+ try {
60
+ const thisDir = dirname(fileURLToPath(import.meta.url));
61
+ const candidate = resolve(thisDir, '..', 'data', 'fonts.json');
62
+ if (existsSync(candidate)) {
63
+ const raw = await readFile(candidate, 'utf-8');
64
+ return JSON.parse(raw);
65
+ }
66
+ }
67
+ catch {
68
+ // ignore
69
+ }
70
+ return null;
71
+ }
55
72
  export function searchSnippets(registry, options) {
56
73
  return searchEntries(registry.snippets, options);
57
74
  }
package/dist/search.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PatternEntry, SnippetEntry } from "./types.js";
1
+ import type { CanvasEffectEntry, FontRecommendation, FontsData, PatternEntry, SnippetEntry } from './types.js';
2
2
  export interface SnippetSearchOptions {
3
3
  query: string;
4
4
  category?: string;
@@ -13,7 +13,7 @@ export declare function searchSnippets(snippets: SnippetEntry[], options: Snippe
13
13
  export interface PatternSearchOptions {
14
14
  query: string;
15
15
  family?: string;
16
- tier?: "base" | "enhanced";
16
+ tier?: 'base' | 'enhanced';
17
17
  domain?: string;
18
18
  tone?: string;
19
19
  uxGoal?: string;
@@ -52,3 +52,12 @@ export interface ComposedPage {
52
52
  warnings: string[];
53
53
  }
54
54
  export declare function composePage(patterns: PatternEntry[], snippets: SnippetEntry[], options: ComposePageOptions): ComposedPage;
55
+ export declare function recommendFonts(fontsData: FontsData, domain: string, tone: string): FontRecommendation;
56
+ export interface CanvasSearchOptions {
57
+ query: string;
58
+ category?: string;
59
+ interactive?: boolean;
60
+ animate?: boolean;
61
+ limit?: number;
62
+ }
63
+ export declare function searchCanvasEffects(effects: CanvasEffectEntry[], options: CanvasSearchOptions): CanvasEffectEntry[];