@utopia-studio-design/design-system-cli 0.1.0 → 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.
- package/README.md +12 -41
- package/bin/utopia-ds-mcp.mjs +55 -0
- package/bin/utopia-ds.mjs +233 -318
- package/data/docs/ai-platform-plan.md +53 -0
- package/data/docs/arabic-friendly.md +72 -0
- package/data/docs/foundations.md +154 -0
- package/data/docs/guide.md +37 -0
- package/data/docs/quick-start-ai.md +122 -0
- package/data/docs/shadcn-conversion.md +35 -0
- package/data/docs/theme-authoring.md +46 -0
- package/data/manifests/catalog.json +546 -0
- package/data/manifests/components.json +4780 -0
- package/data/manifests/patterns.json +12 -0
- package/data/manifests/templates.json +96 -0
- package/data/manifests/theme-barrier-intelligence.json +123 -0
- package/data/manifests/theme-dextrum.json +255 -0
- package/data/manifests/theme-utopia-default.json +163 -0
- package/data/manifests/themes.json +417 -0
- package/data/templates/saas-solution-homepage/README.md +52 -0
- package/data/templates/saas-solution-homepage/agents/index.html +1 -0
- package/data/templates/saas-solution-homepage/changelog/index.html +1 -0
- package/data/templates/saas-solution-homepage/contact-sales/index.html +1 -0
- package/data/templates/saas-solution-homepage/customers/aster-labs/index.html +1 -0
- package/data/templates/saas-solution-homepage/customers/index.html +1 -0
- package/data/templates/saas-solution-homepage/index.html +17 -0
- package/data/templates/saas-solution-homepage/integrations/index.html +1 -0
- package/data/templates/saas-solution-homepage/integrations/slack/index.html +1 -0
- package/data/templates/saas-solution-homepage/main.tsx +642 -0
- package/data/templates/saas-solution-homepage/pricing/index.html +1 -0
- package/data/templates/saas-solution-homepage/product/index.html +1 -0
- package/data/templates/saas-solution-homepage/styles.css +863 -0
- package/data/templates/saas-solution-homepage/template.manifest.json +36 -0
- package/lib/api.mjs +146 -0
- package/package.json +13 -20
- package/LICENSE +0 -21
- package/templates/agent-docs/examples.md +0 -33
- package/templates/agent-docs/index.md +0 -78
- package/templates/agent-docs/llms.txt +0 -33
- package/templates/components/badge.tsx +0 -12
- package/templates/components/brand-action.tsx +0 -32
- package/templates/components/button-group.tsx +0 -30
- package/templates/components/button.tsx +0 -44
- package/templates/components/card.tsx +0 -23
- package/templates/components/cta-section.tsx +0 -34
- package/templates/components/icon-button.tsx +0 -44
- package/templates/components/page-hero.tsx +0 -47
- package/templates/components/tooltip.tsx +0 -48
- package/templates/components/topbar.tsx +0 -59
- package/templates/lib/utils.ts +0 -6
- package/templates/styles/styles.css +0 -271
- package/templates/styles/tokens.css +0 -21
- package/templates/tokens.json +0 -41
package/README.md
CHANGED
|
@@ -1,46 +1,17 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ceramic Design System CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The same structured API powers terminal output, JSON automation, generated agent instructions, and the stdio MCP server.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
|
|
7
|
-
npx
|
|
8
|
-
npx
|
|
9
|
-
npx
|
|
10
|
-
npx
|
|
6
|
+
npm install -D @utopia-studio-design/design-system-cli
|
|
7
|
+
npx utopia-ds init
|
|
8
|
+
npx utopia-ds search "Arabic data table" --json
|
|
9
|
+
npx utopia-ds component DataTable --json
|
|
10
|
+
npx utopia-ds template template-saas-solution-homepage --copy ./saas-website
|
|
11
|
+
npx utopia-ds template template-saas-solution-homepage --theme dextrum --copy ./dextrum-website
|
|
12
|
+
npx utopia-ds theme create nova
|
|
13
|
+
npx utopia-ds manifest --json
|
|
14
|
+
npx utopia-ds mcp
|
|
11
15
|
```
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Doctor Checks
|
|
16
|
-
|
|
17
|
-
`utopia-ds doctor` verifies dependencies, CSS tokens, square-radius compliance, component manifest completeness, component `agentContract` completeness, theme manifest completeness, source-example docs, and the AI entrypoint:
|
|
18
|
-
|
|
19
|
-
AI docs checks:
|
|
20
|
-
|
|
21
|
-
- `docs/design-system/examples.md`
|
|
22
|
-
- `public/llms.txt` references `docs/design-system/examples.md`
|
|
23
|
-
|
|
24
|
-
Component checks:
|
|
25
|
-
|
|
26
|
-
- `props`
|
|
27
|
-
- `anatomy`
|
|
28
|
-
- `states`
|
|
29
|
-
- `slots`
|
|
30
|
-
- `examples`
|
|
31
|
-
- `aiRules`
|
|
32
|
-
|
|
33
|
-
Agent contract checks:
|
|
34
|
-
|
|
35
|
-
- `useWhen`
|
|
36
|
-
- `avoidWhen`
|
|
37
|
-
- `fallbackToShadcn`
|
|
38
|
-
- `requiredTokens`
|
|
39
|
-
- `neverInvent`
|
|
40
|
-
- `validationChecklist`
|
|
41
|
-
|
|
42
|
-
Theme checks:
|
|
43
|
-
|
|
44
|
-
- `defaultTheme`
|
|
45
|
-
- `semanticRoles`
|
|
46
|
-
- default theme values for every semantic role
|
|
17
|
+
Programmatic consumers can import `@utopia-studio-design/design-system-cli/api`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
capabilityManifest, getComponent, getDoc, getTemplate, getTheme,
|
|
4
|
+
listComponents, listDocs, listTemplates, listThemes, repositoryDoctor, search,
|
|
5
|
+
} from '../lib/api.mjs'
|
|
6
|
+
|
|
7
|
+
const tools = [
|
|
8
|
+
['search', 'Search components, docs, templates, and themes.', { query: { type: 'string' } }, ({ query }) => search(query)],
|
|
9
|
+
['list_components', 'List every Ceramic component contract.', {}, () => listComponents()],
|
|
10
|
+
['get_component', 'Get one component including imports, tokens, usage, and Arabic rules.', { name: { type: 'string' } }, ({ name }) => getComponent(name)],
|
|
11
|
+
['list_templates', 'List Ceramic starter templates.', {}, () => listTemplates()],
|
|
12
|
+
['get_template', 'Get a template contract and sections.', { id: { type: 'string' } }, ({ id }) => getTemplate(id)],
|
|
13
|
+
['list_themes', 'List themes that implement the semantic contract.', {}, () => listThemes()],
|
|
14
|
+
['get_theme', 'Get a theme policy and semantic mappings.', { id: { type: 'string' } }, ({ id }) => getTheme(id)],
|
|
15
|
+
['list_docs', 'List AI-readable design-system documents.', {}, () => listDocs()],
|
|
16
|
+
['get_docs', 'Read one design-system document.', { topic: { type: 'string' } }, ({ topic }) => getDoc(topic)],
|
|
17
|
+
['doctor', 'Validate the Ceramic source of truth.', {}, () => repositoryDoctor()],
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
function reply(id, result) {
|
|
21
|
+
process.stdout.write(`${JSON.stringify({ jsonrpc: '2.0', id, result })}\n`)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function error(id, code, message) {
|
|
25
|
+
process.stdout.write(`${JSON.stringify({ jsonrpc: '2.0', id, error: { code, message } })}\n`)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let buffer = ''
|
|
29
|
+
process.stdin.setEncoding('utf8')
|
|
30
|
+
process.stdin.on('data', (chunk) => {
|
|
31
|
+
buffer += chunk
|
|
32
|
+
let index
|
|
33
|
+
while ((index = buffer.indexOf('\n')) >= 0) {
|
|
34
|
+
const line = buffer.slice(0, index).trim()
|
|
35
|
+
buffer = buffer.slice(index + 1)
|
|
36
|
+
if (!line) continue
|
|
37
|
+
try {
|
|
38
|
+
const request = JSON.parse(line)
|
|
39
|
+
if (request.method === 'initialize') reply(request.id, { protocolVersion: '2025-03-26', capabilities: { tools: {} }, serverInfo: { name: 'ceramic-design-system', version: capabilityManifest().version } })
|
|
40
|
+
else if (request.method === 'notifications/initialized') continue
|
|
41
|
+
else if (request.method === 'ping') reply(request.id, {})
|
|
42
|
+
else if (request.method === 'tools/list') reply(request.id, { tools: tools.map(([name, description, properties]) => ({ name, description, inputSchema: { type: 'object', properties, required: Object.keys(properties) } })) })
|
|
43
|
+
else if (request.method === 'tools/call') {
|
|
44
|
+
const tool = tools.find(([name]) => name === request.params?.name)
|
|
45
|
+
if (!tool) error(request.id, -32602, `Unknown tool ${request.params?.name}`)
|
|
46
|
+
else {
|
|
47
|
+
const data = tool[3](request.params?.arguments ?? {})
|
|
48
|
+
reply(request.id, { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }], structuredContent: data, isError: data == null })
|
|
49
|
+
}
|
|
50
|
+
} else error(request.id, -32601, `Method not found: ${request.method}`)
|
|
51
|
+
} catch (cause) {
|
|
52
|
+
error(null, -32700, cause instanceof Error ? cause.message : 'Parse error')
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|