feat(ui): 美化启动界面并重构 /is 工具/插件展示
Some checks failed
npm audit / audit (push) Has been cancelled
CI / build-check-test (push) Has been cancelled

- 缩小标题加 ❯ 引导符、彩色版本号、中文说明
- 去除启动头部段落间空行
- /is 本地扩展和 npm 扩展合并为 [插件] 分组展示
- /is 新增 [工具] 区块显示所有注册工具及激活状态

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 14:32:16 +08:00
parent 675dd18182
commit 731ba23515
5 changed files with 122 additions and 21 deletions

View File

@@ -20,7 +20,7 @@
- 如果用户需要你生成总结文档,教程时,除非用户强制要求,否则默认储存目录为smallmengya的/shumengya/docs 目录下 - 如果用户需要你生成总结文档,教程时,除非用户强制要求,否则默认储存目录为smallmengya的/shumengya/docs 目录下
## 服务器运维规范 ## 服务器运维规范
- `smallmengya`(本机)作为开发环境、测试环境和 LXC 容器宿主机 - `smallmengya`作为开发环境、测试环境和 LXC 容器宿主机
- `bigmengya`(通过 SSH 连接)作为 Docker 容器机 - `bigmengya`(通过 SSH 连接)作为 Docker 容器机
- `alycd`(通过 SSH 连接)作为内网对外开放的服务器 - `alycd`(通过 SSH 连接)作为内网对外开放的服务器

View File

@@ -73,8 +73,11 @@ function renderSproutclawLogo(theme: any, width: number): string[] {
if (width < 96) { if (width < 96) {
return [ return [
[ [
rgb(" ", [100, 200, 255]),
theme.bold(gradientText("SproutClaw")), theme.bold(gradientText("SproutClaw")),
theme.fg("dim", ` v${VERSION}`), rgb(` v${VERSION}`, [170, 235, 255]),
rgb(" · ", [80, 100, 130]),
rgb("萌芽运维开发助手", [190, 170, 255]),
].join(""), ].join(""),
]; ];
} }
@@ -134,16 +137,13 @@ export default function (pi: ExtensionAPI) {
divider, divider,
...renderSproutclawLogo(theme, width), ...renderSproutclawLogo(theme, width),
divider, divider,
rgb("萌芽运维开发 Agent 助手", [170, 235, 255]), rgb("萌芽运维开发Agent助手", [170, 235, 255]),
"",
]; ];
if (expanded) { if (expanded) {
lines.push(expandedInstructions); lines.push(expandedInstructions);
lines.push("");
lines.push(onboarding); lines.push(onboarding);
} else { } else {
lines.push(compactOnboarding); lines.push(compactOnboarding);
lines.push("");
lines.push(onboarding); lines.push(onboarding);
} }
return lines; return lines;

View File

@@ -4746,6 +4746,42 @@ export const MODELS = {
contextWindow: 262144, contextWindow: 262144,
maxTokens: 32768, maxTokens: 32768,
} satisfies Model<"google-generative-ai">, } satisfies Model<"google-generative-ai">,
"gemma-4-E2B-it": {
id: "gemma-4-E2B-it",
name: "Gemma 4 E2B IT",
api: "google-generative-ai",
provider: "google",
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
reasoning: true,
thinkingLevelMap: {"off":null,"minimal":"MINIMAL","low":null,"medium":null,"high":"HIGH"},
input: ["text", "image"],
cost: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
},
contextWindow: 131072,
maxTokens: 8192,
} satisfies Model<"google-generative-ai">,
"gemma-4-E4B-it": {
id: "gemma-4-E4B-it",
name: "Gemma 4 E4B IT",
api: "google-generative-ai",
provider: "google",
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
reasoning: true,
thinkingLevelMap: {"off":null,"minimal":"MINIMAL","low":null,"medium":null,"high":"HIGH"},
input: ["text", "image"],
cost: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
},
contextWindow: 131072,
maxTokens: 8192,
} satisfies Model<"google-generative-ai">,
}, },
"google-vertex": { "google-vertex": {
"gemini-1.5-flash": { "gemini-1.5-flash": {
@@ -12830,6 +12866,25 @@ export const MODELS = {
contextWindow: 262144, contextWindow: 262144,
maxTokens: 131000, maxTokens: 131000,
} satisfies Model<"openai-completions">, } satisfies Model<"openai-completions">,
"moonshotai/Kimi-K2.7-Code": {
id: "moonshotai/Kimi-K2.7-Code",
name: "Kimi K2.7 Code",
api: "openai-completions",
provider: "together",
baseUrl: "https://api.together.ai/v1",
compat: {"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"thinkingFormat":"together"},
reasoning: true,
thinkingLevelMap: {"minimal":null,"low":null,"medium":null},
input: ["text"],
cost: {
input: 0.95,
output: 4,
cacheRead: 0.19,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 131072,
} satisfies Model<"openai-completions">,
"nvidia/nemotron-3-ultra-550b-a55b": { "nvidia/nemotron-3-ultra-550b-a55b": {
id: "nvidia/nemotron-3-ultra-550b-a55b", id: "nvidia/nemotron-3-ultra-550b-a55b",
name: "Nemotron 3 Ultra 550B A55B", name: "Nemotron 3 Ultra 550B A55B",

View File

@@ -1422,19 +1422,30 @@ export class InteractiveMode {
}; };
const { local, packages } = this.splitExtensionsByOrigin(extensions); const { local, packages } = this.splitExtensionsByOrigin(extensions);
const allExtensionLabels = [
...this.getCompactExtensionLabels(local),
...this.getCompactExtensionLabels(packages),
];
const pluginCompactList = formatCompactGrid(allExtensionLabels);
const expandedParts: string[] = [];
if (local.length > 0) { if (local.length > 0) {
const localGroups = this.buildScopeGroups(local); const localGroups = this.buildScopeGroups(local);
const localList = this.formatScopeGroups(localGroups, extensionFormatOptions); const localList = this.formatScopeGroups(localGroups, extensionFormatOptions);
const localCompactList = formatCompactGrid(this.getCompactExtensionLabels(local)); expandedParts.push(
addLoadedSection("本地扩展", localCompactList, localList, "mdHeading", local.length); `${theme.fg("mdHeading", " 本地扩展")} ${theme.fg("muted", String(local.length))}\n${localList}`,
);
} }
if (packages.length > 0) { if (packages.length > 0) {
const packageGroups = this.buildScopeGroups(packages); const packageGroups = this.buildScopeGroups(packages);
const packageList = this.formatScopeGroups(packageGroups, extensionFormatOptions); const packageList = this.formatScopeGroups(packageGroups, extensionFormatOptions);
const packageCompactList = formatCompactGrid(this.getCompactExtensionLabels(packages)); expandedParts.push(
addLoadedSection("npm 扩展", packageCompactList, packageList, "mdHeading", packages.length); `${theme.fg("mdHeading", " npm 扩展")} ${theme.fg("muted", String(packages.length))}\n${packageList}`,
);
} }
const pluginExpandedList = expandedParts.join("\n");
addLoadedSection("插件", pluginCompactList, pluginExpandedList, "mdHeading", extensions.length);
} }
// Show loaded themes (excluding built-in) // Show loaded themes (excluding built-in)
@@ -1459,6 +1470,20 @@ export class InteractiveMode {
); );
addLoadedSection("Themes", themeCompactList, themeList, "mdHeading", customThemes.length); addLoadedSection("Themes", themeCompactList, themeList, "mdHeading", customThemes.length);
} }
const allTools = this.session.getAllTools();
if (allTools.length > 0) {
const activeToolNames = new Set(this.session.getActiveToolNames());
const toolCompactList = formatCompactGrid(allTools.map((t) => t.name));
const toolList = allTools
.map((t) => {
const active = activeToolNames.has(t.name);
const marker = active ? " " : theme.fg("dim", "✗ ");
return `${marker}${theme.fg("dim", t.name)}${t.description ? theme.fg("dim", ` ${t.description.split("\n")[0].slice(0, 60)}`) : ""}`;
})
.join("\n");
addLoadedSection("工具", toolCompactList, toolList, "mdHeading", allTools.length);
}
} }
if (showDiagnostics) { if (showDiagnostics) {

View File

@@ -1,15 +1,36 @@
@echo off @echo off
setlocal setlocal
set "SCRIPT_DIR=%~dp0" set "SCRIPT_DIR=%~dp0"
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%" if "%SCRIPT_DIR:~-1%"=="" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
set "PI_CODING_AGENT_DIR=%SCRIPT_DIR%\.pi\agent" if not defined PI_CODING_AGENT_DIR (
set "PI_CLI_DIST=%SCRIPT_DIR%\packages\coding-agent\dist\cli.js" set "PI_CODING_AGENT_DIR=%SCRIPT_DIR%.piagent"
if not exist "%PI_CLI_DIST%" (
echo Build output not found: %PI_CLI_DIST% >&2
echo Run from repo root: npm run build >&2
exit /b 1
) )
node "%PI_CLI_DIST%" %* if "%~1"=="" goto run
if /I "%~1"=="run" (
shift
goto run
)
if /I "%~1"=="build" (
shift
npm run build %*
exit /b %ERRORLEVEL%
)
if /I "%~1"=="help" goto help
if "%~1"=="-h" goto help
if "%~1"=="--help" goto help
:run
call "%SCRIPT_DIR%pi-built.bat" %*
exit /b %ERRORLEVEL%
:help
echo sproutclaw - SproutClaw pi 构建版启动器
echo.
echo 用法:
echo sproutclaw 启动 pi构建版
echo sproutclaw run [args] 同 sproutclaw
echo sproutclaw build 从源码构建所有包
echo.
echo 其余参数透传给 pi例如: sproutclaw --version
exit /b 0