@getflip/swirl-ai 0.448.0 → 0.448.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/README.md CHANGED
@@ -1,52 +1,81 @@
1
1
  # @getflip/swirl-ai
2
2
 
3
- Swirl Design System artifacts for AI agents: a compact component index,
4
- per-component docs, and the full custom elements manifest with TypeScript types.
3
+ AI integration for the Swirl Design System. Use it as an **MCP server** so
4
+ agents can discover and use Swirl components interactively, or consume the
5
+ **build-time artifacts** directly.
5
6
 
6
- ## Artifacts (after `npm run build`)
7
+ ## MCP server
7
8
 
8
- | Artifact | Path | Purpose |
9
- | ---------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
10
- | **Custom elements manifest** | `dist/custom-elements.manifest.json` | Full CEM schema (tags, props, events, slots, descriptions). Use when you need complete API detail. |
11
- | **Agent components index** | `dist/agent/components-index.json` | Compact, agent-oriented list: tag, summary, required/optional props, events, slots, methods, a11y hints, related components. Prefer this for “which component?” and quick lookup. |
12
- | **Per-component docs** | `dist/agent/components/<tag>.md` | One markdown file per component: purpose, required/optional props, slots, events, methods, composition, accessibility, minimal example, common mistakes. Use for retrieval and code generation. |
13
- | **TypeScript types** | `dist/types/` | Declarations for all components (props, events, methods). Use for type-checking and IDE support. |
9
+ The package ships a Model Context Protocol server with 6 tools:
14
10
 
15
- ## Recommended retrieval order for agents
11
+ | Tool | Description |
12
+ | ------------------------- | ------------------------------------------------------------- |
13
+ | `get_started` | Installation and setup guide (Web Components, Angular, React) |
14
+ | `list_components` | List all UI components (buttons, modals, forms, etc.) |
15
+ | `list_icons` | List all icon components (`swirl-icon-*`) |
16
+ | `list_symbols` | List all symbol components (`swirl-symbol-*`) |
17
+ | `list_emojis` | List all emoji components (`swirl-emoji-*`) |
18
+ | `get_component_details` | Full docs for a component (props, events, slots, examples) |
16
19
 
17
- 1. **Discover** – Load `dist/agent/components-index.json` to choose components
18
- by summary and related components.
19
- 2. **Detail** – For each chosen tag, load `dist/agent/components/<tag>.md` for
20
- usage, composition, and examples.
21
- 3. **Precision** – If needed, use `dist/custom-elements.manifest.json` or
22
- `dist/types/` for exact types and full API.
20
+ ### Usage
23
21
 
24
- ## Package exports
22
+ ```jsonc
23
+ {
24
+ "mcpServers": {
25
+ "swirl-ai": {
26
+ "command": "npx",
27
+ "args": ["-y", "@getflip/swirl-ai"]
28
+ }
29
+ }
30
+ }
31
+ ```
25
32
 
26
- Consumers can resolve these paths from `@getflip/swirl-ai`:
33
+ For local development, point to the built file directly:
27
34
 
28
- - `@getflip/swirl-ai/manifest` → `dist/custom-elements.manifest.json`
29
- - `@getflip/swirl-ai/agent-index` → `dist/agent/components-index.json`
35
+ ```jsonc
36
+ {
37
+ "mcpServers": {
38
+ "swirl-ai": {
39
+ "command": "node",
40
+ "args": ["<path-to-repo>/packages/swirl-ai/dist/mcp/mcp.js"]
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ ### Local testing
47
+
48
+ Use the MCP inspector to call tools interactively in a web UI:
49
+
50
+ ```sh
51
+ npx @modelcontextprotocol/inspector node dist/mcp/mcp.js
52
+ ```
30
53
 
31
- Per-component docs are under `dist/agent/components/` (e.g.
32
- `node_modules/@getflip/swirl-ai/dist/agent/components/swirl-accordion.md`).
33
- Resolve via your bundler or file system relative to the package root.
54
+ Or during development (no rebuild needed after changes):
34
55
 
35
- ## Agent index schema
56
+ ```sh
57
+ npx @modelcontextprotocol/inspector tsx scripts/mcp.ts
58
+ ```
36
59
 
37
- `components-index.json` has `schemaVersion: 1` and a `components` array. Each
38
- entry includes:
60
+ ## Artifacts
39
61
 
40
- - `tag`, `summary`, `whenToUse`, `requiredProps`, `optionalProps`
41
- - `events`, `slots`, `methods`
42
- - `accessibilityInfo`, `compositionRules`, `relatedComponents`, `status`
43
- (`stable` | `deprecated` | `experimental`)
62
+ Build-time artifacts for agents that prefer direct file access:
63
+
64
+ | Artifact | Path | Purpose |
65
+ | ---------------------------- | ------------------------------------ | ---------------------------------------------------------------- |
66
+ | **Agent components index** | `dist/agent/components-index.json` | Lean catalog: tag, summary, and related components per entry. |
67
+ | **Per-component docs** | `dist/agent/components/<tag>.md` | Full markdown docs: props, events, slots, examples, a11y info. |
68
+ | **Custom elements manifest** | `dist/custom-elements.manifest.json` | Full CEM schema (tags, props, events, slots, descriptions). |
69
+ | **TypeScript types** | `dist/types/` | Type declarations for all components. |
70
+
71
+ ### Package exports
72
+
73
+ - `@getflip/swirl-ai/agent-index` → `dist/agent/components-index.json`
74
+ - `@getflip/swirl-ai/manifest` → `dist/custom-elements.manifest.json`
44
75
 
45
- Schema and field semantics are stable within major package versions; new
46
- optional fields may be added.
76
+ Per-component docs are at `dist/agent/components/<tag>.md`.
47
77
 
48
78
  ## Versioning
49
79
 
50
80
  Artifacts are generated from `@getflip/swirl-components` at build time. Keep
51
- `@getflip/swirl-ai` and `@getflip/swirl-components` versions in sync so the
52
- index and docs match the installed components.
81
+ `@getflip/swirl-ai` and `@getflip/swirl-components` versions in sync.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- The SwirlCarouselSlide component is used to display a single slide inside the [SwirlCarousel component](?path=/docs/components-swirldescriptionlist--docs).
5
+ The SwirlCarouselSlide component is used to display a single slide inside the [SwirlCarousel component](?path=/docs/components-swirlcarousel--docs).
6
6
 
7
7
  ## Required props
8
8
 
@@ -61,7 +61,7 @@ No component-specific keyboard behavior.
61
61
  ```html
62
62
  <swirl-carousel-slide label="Label">
63
63
  <img alt="Description" src="/sample-3.jpg" />
64
- </swirl-carousel-slide>
64
+ </swirl-carousel-slide>
65
65
  ```
66
66
 
67
67
  ## Common mistakes
@@ -59,6 +59,7 @@ No component-specific keyboard behavior.
59
59
  <swirl-button label="Button"></swirl-button>
60
60
  <swirl-button intent="primary" label="Button" variant="flat"></swirl-button>
61
61
  </swirl-button-group>
62
+
62
63
  </swirl-empty-state>
63
64
  ```
64
65
 
@@ -60,6 +60,7 @@ No component-specific keyboard behavior.
60
60
  <swirl-form-control label="Email">
61
61
  <swirl-text-input type="email"></swirl-text-input>
62
62
  </swirl-form-control>
63
+
63
64
  </swirl-form-group>
64
65
  ```
65
66
 
@@ -12,7 +12,7 @@ Icons are visual symbols used to represent ideas, objects or actions.
12
12
 
13
13
  - `color` ("critical" | "default" | "disabled" | "highlight" | "info" | "on-action-primary" | "on-image" | "on-status" | "on-surface-highlight" | "on-surface-highlight-subdued" | "strong" | "success" | "warning" | undefined) –
14
14
  - `size` (16 | 20 | 24 | 28 | undefined) –
15
- - `wrapperColor` ("banana" | "blueberry" | "chilli" | "grape" | "kiwi" | "neutral" | "pumpkin" | "radish" | undefined) –
15
+ - `wrapperColor` ("banana" | "blueberry" | "chilli" | "default" | "grape" | "kiwi" | "neutral" | "pumpkin" | "radish" | undefined) –
16
16
  - `wrapperSize` ("2xl" | "l" | "m" | "s" | "xl" | "xs" | undefined) –
17
17
 
18
18
  ## Slots
@@ -117,6 +117,7 @@ and
117
117
  slot="toolbar"
118
118
  variant="on-image"
119
119
  ></swirl-button>
120
+
120
121
  </swirl-lightbox>
121
122
  ```
122
123
 
@@ -103,6 +103,7 @@ control.
103
103
  <swirl-icon-notifications-off size="16"></swirl-icon-notifications-off>
104
104
  <swirl-badge label="1" size="xs"></swirl-badge>
105
105
  </swirl-stack>
106
+
106
107
  </swirl-resource-list-item>
107
108
  ```
108
109