feat(web): agent 控制台重构 — i18n/主题/探活/slashcmd/配置热重载#56
Open
wuchulonly wants to merge 15 commits into
Open
Conversation
cyber-ui 已 vendored 进 src/{ui,markdown,viewer,terminal-view,lib/theme},
删除 submodule 引用;整理忽略规则(运营产物、静态构建残留、泄漏配置)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- base_url 空 provider 时按 host 推断 anthropic/openai 协议,避免误走 openai 协议对 Anthropic-only 网关空体 404 - ANTHROPIC_MODEL 等 provider-env 降级为 fallback-only,新增 AISCAN_MODEL 自有命名空间覆盖,避免 prod env 静默盖过 web 配置 - endpoint hint + provider 能力对齐,补充 parity/hint 测试 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
新增 pkg/probe(conn/llm)做真实可达性探测:llm_available 只表示 client 建好,不查 404;顶栏 LLMHealth 主动 testLLM 才真正探活。 web 侧 probe 端点 + 回归测试。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 新增 pkg/slashcmd 单一目录,驱动 REPL + web + 菜单;hub 按 Scope 路由; /shell 退役改 !bash - TUI /spaces /nodes /messages 改 renderFixedBox(定宽 + ANSI 裁剪 + runewidth CJK 对齐);/status 的 IOA URL 走 redactIOAURL 脱敏 - 补 banner/catalog 渲染回归测试 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- evaluator 结构化断言(criteria→count/exists 确定性 Go + judge 有据判定) - event_json 评估事件序列化 + provider 热切换测试 - truncate/clip 上下文裁剪调整与测试 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- scan collector/jsonl_writer、spray、gogo、zombie、toolargs 调整 - core/output 颜色/格式精简,移除 tool_data - headless request、tavily 搜索小改 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- SSE hub 终端事件可靠投递、config 热重载(ReloadProvider 热切换 provider) - store 迁移到 sqlite(删除内存 store),会话/scan 级联删除、agent 稳定身份 - webagent 上传路径注入 LLM、eval 转发 extractEventData 修复 - slashcmd web 端点、localagent 本地启动;补 config_reload/command/sse/ eval_forward/upload 回归测试 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 中英 i18n(i18n/locales,MiSans CJK 字体),LanguageToggle/主题系统
- vendored cyber-ui 进 src/{ui,markdown,viewer,terminal-view,lib/theme};
手搓原子组件收敛(Button/Badge/Callout/Field/StatTile…)
- 聊天页去 chatbot 味:身份归左 rail、AI=蓝、composer 融成单一 well;
LLMHealth 主动探活、ModelCombobox 模型选择
- 删除独立 scan 页/侧栏/report 视图,scanning 内联进 agent 聊天
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
前端重构后重新构建 web/static(i18n/主题/字体 chunk、MiSans 子集), 更新编译期内嵌的 hash 化资源。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
原子层回归共享库单一真相源:aiscan 贡献的原子已合并进 cyber-ui (chainreactors/cyber-ui#1),这里改回从子模块消费,删除 vendored 副本。 - 重新引入 web/frontend/cyber-ui 子模块(pin 合并后 6b80eb3) - vite/tsconfig 恢复 @aspect/ui + @aspect/theme alias → 子模块 packages - tailwind preset 改指子模块 theme - 全量改写 import:@/ui→@aspect/ui(16)、@/lib/theme→@aspect/theme(50) - 删除 vendored src/ui、src/lib/theme(33 文件) - markdown/viewer/terminal 保持 vendored(aiscan 深度定制的复合组件, 非原子),仅把其内部引用改指子模块 - ConfirmDialog 已在上游去 i18n 耦合,新增 LocalizedConfirmProvider 在 main.tsx 注入本地化 labels,保住中文确认框 验证:tsc --noEmit 绿;vite build 全量 2041 模块转换 + emit 成功。 web/static 内嵌产物运行时等价(仅 import 解析路径变化),部署时 npm run build 重生成;本机 web/static/assets 为 root-owned 历史残留未动。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the local replace bridge and pin github.com/chainreactors/sdk to v0.3.4-0.20260707120839-686d4bfa2b2b (chainreactors/sdk#31, merged), which populates gogo's pkg.ChainExec when the SDK injects neutron templates. This fixes the ants "worker exits from panic" nil-pointer that aborted exploit scanning on every open host. TestGogoEngineInjectsChainExecutor now passes against the real pinned SDK (no replace). Refs #51 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…A1019)
- errcheck: store_sqlite tx.Rollback 两处显式忽略返回值
- nilerr: 上传结果非 JSON 时兜底合并两条重复分支,消除 nil-return(真重构,非 nolint)
- gosec G120: handler 上传先 http.MaxBytesReader 封顶 body,再行级 nolint(这版 gosec sanitizer 列表为空,识别不了缓解)
- misspell: banner_render_test 注释 colour→color
- unused: 删除退役 /shell 遗留的死代码 handleShellCommand
- SA1019+死代码: 端口配置已改走 resource-provider 管道(gogo 自设 utils.PrePort),
删除冗余且无人读取的 PortPreset / installLocalPortPreset;测试改为断言真正的
provider 契约 GogoConfig("port")
注:tidy 的 go-runewidth 提为直接依赖已随 64694d7(sdk bump 的 go mod tidy)进入 HEAD。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
删除 64694d7 bump 后不再被引用的旧版 chainreactors/sdk (v0.3.4-0.20260704194820-4141f24c2bcd)哈希;`go mod tidy` 现已干净, 修复 CI 的 tidy job。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
agent 侧 fenceTerminalOutput 给多行 REPL/shell 输出包 Markdown 代码围栏 (/status /provider /nodes 等盒子画符+列对齐只在定宽保换行下成立);web 聊天按 Markdown 散文渲染会把单换行折成空格+比例字体,面板塌成一行。 前端 MarkdownContent 对含换行的无 info-string fenced block 也判为块级, 避免退化成行内 pill。单行输出仍走散文。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
子模块推进 6b80eb3→4832385(第二刀原子 + terminal 包)。aiscan 接过去: - 设计系统第二刀收敛:手搓 <button>→@aspect/ui Button(App/SessionList/ ConfigPanel/ScanProgressInline 等),消费新原子 DisclosureCard/ResultLine/ Switch;新建 aiscan-local AiPanel(抽「AI 研判」面板签名)、AgentVoiceCard (抽「AI 语气」卡壳,viewer 三处共用) - terminal-view 迁入子模块:删 vendored src/terminal-view(465 行), vite/tsconfig 加 @aspect/terminal alias,AgentTerminal/TerminalDetails 改从 @aspect/terminal 消费 验证:tsc --noEmit 绿。web/static 内嵌产物部署时重建。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
Agent 控制台重构分支:前端去 chatbot 味 + i18n + 主题系统,后端新增探活/本地 agent/统一命令目录/配置热重载/结构化评估。共 9 个逻辑提交。
改动分组
chorefix(provider)feat(probe)feat(slashcmd)refactor(agent)refactor(tools)feat(web)feat(web-ui)chore(web)规模
备注
🤖 Generated with Claude Code