@cascivo/mcp 0.1.0 → 0.1.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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@cascivo/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
- "description": "MCP server exposing the cascade component registry to AI agents",
5
+ "description": "MCP server exposing the cascivo component registry to AI agents",
6
6
  "keywords": [
7
7
  "ai",
8
8
  "cascivo",
@@ -48,7 +48,7 @@
48
48
  "devDependencies": {
49
49
  "@types/node": "^25",
50
50
  "typescript": "^5",
51
- "vite-plus": "^0.1.24"
51
+ "vite-plus": "^0.2.1"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "vp pack && node -e \"const fs=require('fs');const f='dist/index.mjs';const c=fs.readFileSync(f,'utf8');if(!c.startsWith('#!/'))fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c);fs.copyFileSync('../../registry.json','dist/registry.json')\" && chmod +x dist/index.mjs",
package/readme.body.md CHANGED
@@ -17,17 +17,40 @@ The server speaks the MCP stdio transport. By default it reads the `registry.jso
17
17
 
18
18
  ## Tools
19
19
 
20
- | Tool | Input | Returns |
21
- | ------------------- | ------------------------------------- | -------------------------------------------------------- |
22
- | `list_components` | `{ category? }` | All component manifests, optionally filtered by category |
23
- | `get_component` | `{ name }` | The full manifest for one component |
24
- | `search_components` | `{ query }` | Components matching name, tags, or description |
25
- | `add_to_project` | `{ name, outputDir? }` | Runs `cascivo add <name>` as a child process |
26
- | `create_theme` | `{ primary, neutral, accent, name? }` | A custom theme as CSS (semantic token layer) |
27
- | `scaffold_page` | `{ description, components? }` | A JSX page layout string |
20
+ | Tool | Input | Returns |
21
+ | ------------------- | ------------------------------------- | ------------------------------------------------------------------------------------ |
22
+ | `list_components` | `{ category? }` | All component manifests, optionally filtered by category |
23
+ | `get_component` | `{ name }` | The full manifest for one component |
24
+ | `search_components` | `{ query }` | Components matching name, tags, or description |
25
+ | `add_to_project` | `{ name, outputDir? }` | Runs `cascivo add <name>` as a child process |
26
+ | `create_theme` | `{ primary, neutral, accent, name? }` | A custom theme as CSS (semantic token layer) |
27
+ | `scaffold_page` | `{ description, components? }` | A JSX page layout string |
28
+ | `scaffold_view` | `{ description, components? }` | A validated starter `ViewConfig` + the bound-vocabulary `grammar` for its components |
29
+ | `validate_view` | `{ config }` | Validation errors (component, prop type/enum, refs) with exact paths |
30
+ | `get_view_grammar` | `{ components? }` | Bound-vocabulary grammar + generation prompt for valid `ViewConfig` JSON |
28
31
 
29
32
  `category` is one of `inputs`, `display`, `overlay`, `navigation`, `feedback`.
30
33
 
34
+ ### Bound-vocabulary generation (anti-hallucination)
35
+
36
+ `get_view_grammar` derives — from the `component.meta.ts` manifests — a **system
37
+ prompt** plus a compact **allowed-vocabulary grammar** (each component → its
38
+ props → enum/size/variant values) for emitting valid `ViewConfig` JSON rendered
39
+ by `@cascivo/render` `<CascadeView />`. This is [OpenUI](https://openui.com)'s
40
+ "generate the system prompt from the component library" mechanism (see
41
+ [`docs/ROADMAP-V40.md`](../../docs/ROADMAP-V40.md)): because the grammar is
42
+ **derived**, not authored, an LLM is structurally prevented from inventing
43
+ components, props, or enum values, and the grammar can never drift from the
44
+ components. Pair it with `validate_view` (which now also checks prop types/enums)
45
+ as the enforcement backstop.
46
+
47
+ ```ts
48
+ import { buildGenerationPrompt, loadRegistry } from '@cascivo/mcp'
49
+
50
+ const prompt = buildGenerationPrompt(loadRegistry(), { components: ['Badge', 'Button'] })
51
+ // → use as the system prompt; the model can only emit Badge/Button with their real props.
52
+ ```
53
+
31
54
  ## Programmatic use
32
55
 
33
56
  ```ts