v0.6.0: beautifului 整合 + 会话/工作区/队列/权限/命令/附件全链路

- beautifului.dev 组件直连:Sidebar Nav、Tool Chips、Approval Card(抽屉化)、Streaming/Thinking、Code Block、Selection Actions、Prompt Bar、Search
This commit is contained in:
Rick Ye
2026-09-06 09:57:14 +08:00
parent 3c2e9e96c5
commit a5951849c8
96 changed files with 11828 additions and 4649 deletions
+47
View File
@@ -0,0 +1,47 @@
// 下载 beautifului.dev registry:索引 + 候选组件 JSON,保存到 scripts/beautifului/
import { mkdir, writeFile } from 'node:fs/promises'
const outDir = new URL('./beautifului/', import.meta.url)
await mkdir(outDir, { recursive: true })
async function grab(slug) {
const r = await fetch(`https://www.beautifului.dev/r/${slug}.json`)
if (!r.ok) {
console.log(slug, '=> HTTP', r.status)
return null
}
const text = await r.text()
await writeFile(new URL(`${slug}.json`, outDir), text)
return JSON.parse(text)
}
// 1) registry 索引
const idx = await grab('registry')
if (idx) {
const items = Array.isArray(idx) ? idx : idx.items || []
console.log('=== registry index ===')
for (const it of items) console.log('-', it.name, '|', it.title || '', '|', it.type || '')
}
// 2) 候选组件(含传递依赖)
const wanted = [
'foundation',
'loading-state',
'streaming-text',
'tool-chips',
'approval-card',
'button',
'glide-menu',
'task-rows',
'prompt-bar',
'selection-actions',
'shimmer',
'stream-text'
]
console.log('=== components ===')
for (const s of wanted) {
const j = await grab(s)
if (!j) continue
const files = (j.files || []).map((f) => f.path).join(', ')
console.log(`${s}: deps=${JSON.stringify(j.dependencies || [])} files=[${files}]`)
}