sintbot 1.0.10 → 1.0.11
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/CHANGELOG.en.json +10 -0
- package/CHANGELOG.json +11 -0
- package/bin/sbot.js +24 -0
- package/package.json +1 -1
- package/src/design.js +6 -4
- package/src/installdeps.js +8 -2
package/CHANGELOG.en.json
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"name": "Icon libraries from the setup wizard",
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"t": "The wizard installs the icon libraries",
|
|
8
|
+
"d": "When the design icon libraries (Lucide, Tabler, Phosphor and Pixelarticons) are missing, the setup wizard now offers to install them in one go (about 170 MB). With them, the bot uses standard icons by name when it draws a design instead of drawing its own."
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
},
|
|
2
12
|
{
|
|
3
13
|
"version": "1.0.10",
|
|
4
14
|
"name": "A steadier background service",
|
package/CHANGELOG.json
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"date": "2026-10-26",
|
|
5
|
+
"name": "安装向导代装设计图标库",
|
|
6
|
+
"items": [
|
|
7
|
+
{
|
|
8
|
+
"t": "向导代装设计图标库",
|
|
9
|
+
"d": "安装向导发现设计图标库(Lucide、Tabler、Phosphor、Pixelarticons)没装时,会问一句要不要一次装齐(约 170 MB);装好后机器人出设计图能按名字取到标准图标,不用自己画。"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
2
13
|
{
|
|
3
14
|
"version": "1.0.10",
|
|
4
15
|
"date": "2026-10-26",
|
package/bin/sbot.js
CHANGED
|
@@ -1417,6 +1417,30 @@ async function cmdSetup(rest) {
|
|
|
1417
1417
|
codexLoggedIn = !!(codexLogin && codexLogin.ok && codexLogin.loggedIn)
|
|
1418
1418
|
process.stdout.write(` ${cyan('✓')} codex ${dim(codexBin)}${codexOut ? ' ' + yellow('没登录 —— GPT 群、生图、额度用完时自动切到 codex 都要它:跑一次 codex login') : ''}\n`)
|
|
1419
1419
|
}
|
|
1420
|
+
// 设计图标库(Lucide / Tabler / Phosphor / Pixelarticons):agent 出设计图时按名字取图标,缺了只能自己画、
|
|
1421
|
+
// 与设计图对不上。缺哪套问一句一次装齐(默认装);没人回答(输入已结束)不装,doctor 会接着提示
|
|
1422
|
+
{
|
|
1423
|
+
const iconRoots = () => design.iconRoots({ base: path.join(__dirname, '..'), extra: (raw.design && raw.design.iconsDir) || null })
|
|
1424
|
+
const missing = () => Object.entries(iconRoots()).filter(([, v]) => !v).map(([k]) => k)
|
|
1425
|
+
const miss = missing()
|
|
1426
|
+
if (!miss.length) process.stdout.write(` ${cyan('✓')} 设计图标库 ${dim(Object.values(design.ICON_LIBS).map((l) => l.label).join(' · '))}\n`)
|
|
1427
|
+
else {
|
|
1428
|
+
const libs = miss.map((k) => design.ICON_LIBS[k])
|
|
1429
|
+
const pkgs = libs.map((l) => l.pkg)
|
|
1430
|
+
const mb = Math.round(libs.reduce((n, l) => n + (l.mb || 0), 0))
|
|
1431
|
+
process.stdout.write(` ${gray('○')} 设计图标库缺 ${libs.map((l) => l.label).join(' / ')}(出设计图时 agent 按名字取图标)\n`)
|
|
1432
|
+
if (await askYN(`现在安装(npm i -g ${pkgs.join(' ')},约 ${mb} MB)?`, true, false)) {
|
|
1433
|
+
const r = installdeps.installPackages(pkgs, { log: (l) => process.stdout.write(dim(' ' + l) + '\n') })
|
|
1434
|
+
const still = missing()
|
|
1435
|
+
if (r.ok && !still.length) process.stdout.write(` ${cyan('✓')} 设计图标库已装\n`)
|
|
1436
|
+
else if (r.ok) {
|
|
1437
|
+
const pre = installdeps.globalPrefix()
|
|
1438
|
+
const dir = pre ? (process.platform === 'win32' ? path.join(pre, 'node_modules') : path.join(pre, 'lib', 'node_modules')) : 'npm 全局目录下的 node_modules'
|
|
1439
|
+
process.stdout.write(` ${yellow('!')} 装好了,但 sbot 找不到 ${still.join(' / ')} —— 在配置里把 design.iconsDir 设成 ${dir}\n`)
|
|
1440
|
+
} else process.stdout.write(` ${red('✗')} 安装失败(退出码 ${r.code})—— 多半是 npm 全局目录没有写权限,之后可以自己装:npm i -g ${pkgs.join(' ')}\n`)
|
|
1441
|
+
} else process.stdout.write(dim(` 要用时再装:npm i -g ${pkgs.join(' ')}`) + '\n')
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1420
1444
|
process.stdout.write(dim(` 配置文件:${cfgPath}`) + '\n\n')
|
|
1421
1445
|
|
|
1422
1446
|
// 地区:决定有国际站的厂商连哪个站、要不要问代理、聊天平台推荐哪个(时区只给默认值,以回答为准)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sintbot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Drive headless Claude Code (or Codex) from Slack / Feishu / WeCom group chats — one group, one project, swappable model brain. A standalone daemon, not a Claude Code plugin.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sbot": "bin/sbot.js",
|
package/src/design.js
CHANGED
|
@@ -3154,16 +3154,18 @@ function _landingSentence(v, { mobile = false } = {}) {
|
|
|
3154
3154
|
// 误报成「描边不合规」,而误报会让整份报告被无视(v0.11.29 间距/阴影不测是同一条理由)。
|
|
3155
3155
|
// ⚠ `dirs` 从字符串数组改成结构:一个目录是什么形态、什么字重、文件名带什么后缀,**都得显式声明**,
|
|
3156
3156
|
// 不能再靠对路径做正则(phosphor 的 fill 目录叫 `fill` 不叫 `filled`,正则当场就错)。
|
|
3157
|
+
// mb = 装好后实际占的磁盘(2026-10 在 macOS 上 du 实测;几千个小文件按块计,比 npm 报的 unpackedSize 大一倍多)。
|
|
3158
|
+
// 向导问「要不要代装」时报合计,版本变了会有出入
|
|
3157
3159
|
const ICON_LIBS = {
|
|
3158
3160
|
// lucide 与 tabler 的分发文件属性逐字相同(24 网格 / fill:none / stroke:currentColor / 2 / round),
|
|
3159
3161
|
// **参数同构才是混用的依据** —— 检查按参数判、不按库名判,兜底也只在同构的两套之间成立。
|
|
3160
|
-
lucide: { pkg: 'lucide-static', label: 'Lucide', license: 'ISC', form: 'stroke', grid: 24, dirs: [{ dir: 'icons', style: 'outlined' }] },
|
|
3161
|
-
tabler: { pkg: '@tabler/icons', label: 'Tabler', license: 'MIT', form: 'stroke', grid: 24, dirs: [{ dir: 'icons/outline', style: 'outlined' }, { dir: 'icons/filled', style: 'filled' }] },
|
|
3162
|
+
lucide: { pkg: 'lucide-static', mb: 66, label: 'Lucide', license: 'ISC', form: 'stroke', grid: 24, dirs: [{ dir: 'icons', style: 'outlined' }] },
|
|
3163
|
+
tabler: { pkg: '@tabler/icons', mb: 49, label: 'Tabler', license: 'MIT', form: 'stroke', grid: 24, dirs: [{ dir: 'icons/outline', style: 'outlined' }, { dir: 'icons/filled', style: 'filled' }] },
|
|
3162
3164
|
// ⚠ phosphor:**六个字重是六套独立几何**(不是同一套图的粗细参数),且 regular 档文件名无后缀、
|
|
3163
3165
|
// 其余带 `-{字重}` 后缀(`gear.svg` / `gear-bold.svg`)—— 这是 `suffix` 字段存在的唯一理由。
|
|
3164
3166
|
// duotone 用两条 path + opacity 0.2 做副色,副色仍继承 currentColor(不是第二种颜色)。
|
|
3165
3167
|
phosphor: {
|
|
3166
|
-
pkg: '@phosphor-icons/core', label: 'Phosphor', license: 'MIT', form: 'fill', grid: 256,
|
|
3168
|
+
pkg: '@phosphor-icons/core', mb: 37, label: 'Phosphor', license: 'MIT', form: 'fill', grid: 256,
|
|
3167
3169
|
dirs: [
|
|
3168
3170
|
{ dir: 'assets/thin', style: 'outlined', weight: 'thin', suffix: '-thin' },
|
|
3169
3171
|
{ dir: 'assets/light', style: 'outlined', weight: 'light', suffix: '-light' },
|
|
@@ -3175,7 +3177,7 @@ const ICON_LIBS = {
|
|
|
3175
3177
|
},
|
|
3176
3178
|
// ⚠ pixelart:实心变体是**同目录 `-solid` 后缀**(不是子目录),而且**只覆盖 53/651**(实测)
|
|
3177
3179
|
// ⇒ 系统那边**不声明支持实心** —— 声明了就是句假话,八成的名字取不到实心。
|
|
3178
|
-
pixelart: { pkg: 'pixelarticons', label: 'Pixelarticons', license: 'MIT', form: 'fill', grid: 24, dirs: [{ dir: 'svg', style: 'outlined' }] },
|
|
3180
|
+
pixelart: { pkg: 'pixelarticons', mb: 15, label: 'Pixelarticons', license: 'MIT', form: 'fill', grid: 24, dirs: [{ dir: 'svg', style: 'outlined' }] },
|
|
3179
3181
|
}
|
|
3180
3182
|
// ── 图标系统(v0.11.53)= 与设计风格**平级**的实体 ────────────────────────────
|
|
3181
3183
|
// **图标系统 = 图形从哪来 + 叫什么名 + 怎么起名;风格 = 我用哪套 + 怎么画它。**
|
package/src/installdeps.js
CHANGED
|
@@ -21,8 +21,9 @@ function chooseRegistry(configured, officialReachable) {
|
|
|
21
21
|
return { registry: MIRROR, reason: 'mirror' }
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
// pkg 可以是一个包名,也可以是一组(设计图标库四个包一条命令装齐)
|
|
24
25
|
function installArgs(pkg, registry) {
|
|
25
|
-
return ['install', '-g', pkg, ...(registry ? ['--registry', registry] : [])]
|
|
26
|
+
return ['install', '-g', ...[].concat(pkg), ...(registry ? ['--registry', registry] : [])]
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
function runNpm(args, opts = {}) {
|
|
@@ -55,6 +56,11 @@ function globalPrefix(run = runNpm) {
|
|
|
55
56
|
function installGlobal(name, { run = runNpm, log = () => {} } = {}) {
|
|
56
57
|
const pkg = PACKAGES[name]
|
|
57
58
|
if (!pkg) throw new Error(`unknown package: ${name}`)
|
|
59
|
+
return installPackages(pkg, { run, log })
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 按包名装(一个或一组),选源同上。只给向导装确定的包用(Claude Code / Codex / 设计图标库),不接用户输入的名字
|
|
63
|
+
function installPackages(pkg, { run = runNpm, log = () => {} } = {}) {
|
|
58
64
|
const { registry, reason } = pickRegistry(run)
|
|
59
65
|
if (reason === 'mirror') log(`npm 官方源连不上,改用国内镜像 ${MIRROR}`)
|
|
60
66
|
const args = installArgs(pkg, registry)
|
|
@@ -63,4 +69,4 @@ function installGlobal(name, { run = runNpm, log = () => {} } = {}) {
|
|
|
63
69
|
return { ok: r.status === 0, pkg, registry, code: r.status }
|
|
64
70
|
}
|
|
65
71
|
|
|
66
|
-
module.exports = { OFFICIAL, MIRROR, PACKAGES, isOfficial, chooseRegistry, installArgs, pickRegistry, globalPrefix, installGlobal }
|
|
72
|
+
module.exports = { OFFICIAL, MIRROR, PACKAGES, isOfficial, chooseRegistry, installArgs, pickRegistry, globalPrefix, installGlobal, installPackages }
|