Skip to content

v1.0.3

Choose a tag to compare

@github-actions github-actions released this 21 Oct 15:36
· 28 commits to main since this release

[1.0.3] - 2026-10-21

主窗口关闭与托盘(2026-10-21)

  • 主窗口点关闭改为询问“隐藏到托盘 / 关闭程序 / 取消”,并说明隐藏后 QQ 机器人继续在后台运行;选择关闭时再确认一次,退出会同步停止 QQ 机器人。
  • 新增系统托盘图标:显示主窗口、隐藏到托盘、关闭 Cupbox;托盘不可用时关闭询问只保留关闭或取消,不假装已隐藏。

开屏公告(2026-10-21)

  • 新增仓库根目录 announcement.json:启动动画结束后显示 GitHub 上的公告,标题、正文、日期与可选链接;测试公告为“欢迎使用 Cupbox 工具箱”。
  • 每次启动检测一次公告,内容(标题 / 正文 / 日期 / id)变化后即使勾过“不再提示”也会再显示;同版本勾选后不再弹出。检查失败静默跳过,不打扰启动。
  • 正文按纯文本渲染、链接只放行 https;可用 CUPBOX_ANNOUNCEMENT_URL 覆盖地址、CUPBOX_ANNOUNCEMENT_DISABLE=1 关闭。说明见 docs/ANNOUNCEMENTS.md。

QQ 机器人(2026-10-21)

  • 新增“1021 角色交流”构建:重写鲸鱼娘身份与语气示例,区分角色询问和现实身份追问;旧套壳自述仅从模型上下文略过,原始记忆不删除。增加可关闭的一次无工具语气校正,先检查再分段,明确提示可能增加请求。

  • 新增“1021 表情直发”构建标识(版本仍1.0.3),同步常用便携目录;明确索取任意表情时直接执行真实发送,区分图库总数与匹配数,避免模型凭空自述不能发图。增加3张原创透明猫咪表情的预览、确认添加/开启及重复保护。

  • 扩充为14款内置人格与自定义选项,新增分类/搜索/示例卡片;增加甜甜恋爱、慢热攻略、角色定位、称呼、4种故事场景和发展节奏。攻略通过原话依据提议、实际回复后存档,按账号/会话/用户/人格/场景隔离,默认私聊,支持确认后单路线重置。

  • 参考 Amadeus 适配陪伴聊天:分层人格、同人连续消息合并、明确群范围的静默/批量插话判断、安静跳过与直接 @ 优先;新增有原话证据的偏好档案、时间与记忆工具、界面推荐草稿和独立风险确认。原有开关不自动开启,版本保持 1.0.3。

  • 参考 dsh-meme 的搜索 / 发送 / 结果反馈流程,增加当前会话专用 send_meme 工具、按含义选图、免费文本模型兼容,以及随对话持久保存的真实发送结果;原关键词限制保留,失败不补发,有工具的轮次等结果后再分段输出。

  • 修复表情过度依赖模型 ID 的发送条件,增加命中触发词自动选择/仅模型判断、单字触发词、总开关状态、本地条件检查与确认后手动测试。

  • 增加图片解码规范化、QQ 发送返回码与消息编号校验,错误或未知结果不自动重发。

  • 新增实时控制台:阶段/级别筛选、搜索、暂停、自动滚动、错误提醒、脱敏复制及 JSONL 导出;保留有限内存日志,默认不写聊天正文、密钥和图片数据。

  • 自动记忆持久保存到系统文档目录,支持同账号全局共享或每群/私聊隔离;停止、暂停或关闭自动记忆不删除文件,提供查看、编辑与二次确认删除。

  • 免费模型可参与工作流与实验性 JSON 工具兼容循环,增加第三方数据、限流和不稳定性警告;本地操作逐次批准,格式异常或执行失败即停止,保留路径与预览保护。

  • 重做 QQ 空间布局:紧凑连接区、本地聊天节奏预览、按需展开的高级设置;增加侧栏、页面、开关、气泡、弹窗动画与减少动态效果适配。

  • 自然语意分段替代默认的机械截字,短回复、代码、列表保持完整;保留按字数兼容选项。新增口语 / 均衡 / 详细三种聊天表达策略。

  • 正常对话记忆与旁听独立,默认记住已触发的对话,旁听仍默认关闭;保持群私聊隔离及临时内存生命周期。

  • 重做配置步骤、已保存范围与草稿提示,区分登录和自动回复;增加立即暂停及启用、数据共享、清除上下文、覆盖记忆的风险确认。

  • 增加所有群 / 白名单 / 黑名单与登录后勾选实际群列表;排除群不收集上下文,旧允许群号自动迁移。

  • 增加可配置分段式流式回复、段间节奏与逐段限流;文本 SSE 边生成边发送,工具流程完成后分段,停止后不重发已发段落。

  • 提交模型的消息正文与 QQ 身份分离,历史使用独立身份字段,避免 QQ 号与正文混在一起。

  • 新增单独机器人窗口,托管 NapCat 的准备、校验、自动配置、二维码登录与心跳重连,无需手填 OneBot 配置。

  • 群内 @ / 关键词、私聊与称呼、群号范围、分会话上下文条数和限流可自定义;默认关闭自动回复和旁听。

  • 复用模型库与应用全局记忆,独立选择聊天 / 工作模式、人格、温度、思考深度;搜索和识图可单独关闭。

  • 自定义表情含义与触发词,后端核验后最多发送一张;主人工作请求的本地文件操作逐次批准。

  • 保持版本 1.0.3;使用及上游来源见 docs/QQ-BOT.md。

Windows 安装版

  • 新增完整离线安装包、中文品牌欢迎页、樱花深浅色引导图片、步骤提示与快速上手介绍。
  • 可选安装位置、开始菜单及桌面快捷方式;支持覆盖安装和卸载,保留用户对话与配置,不添加开机自启。
  • 新增 npm run pack:installer 与 SHA256 校验输出,独立暂存构建,不再清空整个 release。版本保持 1.0.3。
  • 安装说明与代码签名现状见 docs/WINDOWS-INSTALLER.md。

免费模型、对话选择与思考深度

  • 补齐免费目录刷新、总开关与逐模型开关、最小连接检测、用于对话入口;不可用通道不放行,关闭时不自动换服务。
  • 输入框模型按钮改为可搜索的分组菜单,直接切换模型;新增模型感知的思考深度滑块与逐模型记忆,保存并恢复会话选择。
  • 深度实际映射 OpenAI / DeepSeek / OpenRouter 参数;未知型号保留默认或显式指定适配。免费请求不沿用付费密钥,取消信号传入网络层。
  • 交互参考 dsh-codex-effort-slider,独立适配现有桌面界面;保留减少动态效果,版本仍为 1.0.3。说明见 docs/CHAT-MODELS-AND-EFFORT.md。

功能插画与图标动效

  • 新增四张透明功能插画,用于首页快捷入口、工具分类、搜索空状态与模型协作引导。
  • 设置、通知、文件夹、工具、搜索等图标响应悬停与键盘聚焦;复制成功显示短暂勾选,子任务图标对应真实运行状态。
  • 支持系统减少动态效果,保留文字反馈;不引入网络图标或动画依赖。
  • 资源与最终提示词见 docs/FEATURE-VISUALS.md。

界面与风险交互

  • 重做默认启动开场,新增樱花晴窗插画,保留本地自定义素材与减少动态效果支持。
  • 新增分级通知卡片和通知中心;错误手动关闭,提示可回看。
  • 风险窗口优先展示后果、目标和目录,高风险需勾选确认;完全控制与本机环境切换增加事前说明。
  • 统一设置页层级、字号、卡片和按压反馈;开发工具增加中文字段及空状态,命令工具纠正过期白名单表单。
  • 详见 docs/UI-EXPERIENCE.md,包含素材来源及最终提示词。

开发工具能力补全

  • 桌面 Agent 新增 36 项开发工具接口,覆盖分页文件读写/补丁/备份回滚、HTTP、diff/grep/replace、真实持久 ConPTY、进程/端口、图片处理、Git、项目脚本/测试解析、项目记忆/待办、上下文归因与图片剪贴板。
  • 破坏性文件修改默认预览,使用参数与快照绑定的一次性令牌提交;拒绝路径及 junction 越界。
  • 项目策略提案不自动信任,Shell 和终端输入即使完全控制也必须人工批准;域名授权与 DNS 地址固定阻止 SSRF。
  • 新增“开发与授权”操作界面、结构化结果、预览执行按钮与策略编辑。大段工具结果压缩时仍保留有效 JSON 和令牌。
  • 详见 docs/WORKBENCH.md(含安全收敛与边界)。

回复、评价与场景工作流

  • 复用 Marked 和 DOMPurify 渲染 Markdown,新增正文、Markdown 与代码块复制;工具轨迹折叠、文件工具中文名称。
  • 新增有帮助 / 不准确评价,影响后续参考与历史过滤;明确确认后保存长期记忆,支持修改和移除,差评撤销对应已存记忆并重建摘要。
  • 新增任务场景、自动流程选择、依赖调度、上游交付传递、失败阻断与可选验收 / 一次修正。
  • 复用官方 MCP Filesystem 的 10 项文件能力,执行模式下子项目独立目录落盘,协调模型整合;写入继续使用批准机制。便携打包包含完整生产依赖。
  • 详见 docs/RESPONSES-AND-WORKFLOWS.md。

上下文洞察(能力方向致敬 dsh-context)

  • 新增 src/core/context.ts:token 固定密度估算(中文≈1.5 字符/token、西文≈4 字符/token)、六成分分解(系统提示词 / 工具 Schema / 用户消息 / 注入上下文 / 助手回复 / 工具结果)、趋势点与事件的追加与裁剪、紧凑 token 展示。
  • 新增 CLI cupbox context [--text 文本] [--file 路径] [--window 128000] [--json]:估算文本占用;不传文本时返回 Agent 基线开销(系统提示词 + 全部工具 Schema 合计)。
  • MCP 新增 context_stats 工具(只读),工具总数 20 → 21;编排层 TOOL_DEFS 同步至 19。
  • AI 调用开始采集提供方上报的真实 usage:aiChat 读取 Anthropic input_tokens/output_tokens 与 OpenAI prompt_tokens/completion_tokens,aiAgent 循环内累加并返回请求数。
  • 桌面版:每轮对话把成分分解、占用趋势(含真实 in/out)、四类事件(注入 / 压缩 / 切换模型 / 切换模式)写进会话记录;对话页新增「上下文」按钮,弹窗展示 KPI(最近占用、累计请求、累计输入 / 输出)、六成分堆叠条、逐请求趋势柱与事件流;CUPBOX_CONTEXT_WINDOW 可调整窗口大小。
  • 估算为启发式(≈),非精确 tokenizer 计数,仅作占用参考。

同版本既有更新(2026-10-19)

存储与模型管理

  • 数据目录默认迁到系统「文档」Documents/Cupbox(配置、密钥、模型库、会话、记忆全在此),旧 ~/.cupbox 首次启动自动迁移:只复制不删除、新目录已有内容绝不覆盖、失败静默不影响启动;CUPBOX_HOME 仍可整体覆盖(便携/测试隔离)。
  • 新增 src/core/paths.ts 统一解析数据目录(CLI / MCP / 桌面三形态同一语义),CLI main 与 MCP startMcpServer 启动时自动迁移。
  • 设置 → 模型连接新增**「API 储存管理」卡片**:显示当前数据目录、一键打开储存文件夹、定位 config.json。
  • 侧栏新增**「模型管理」入口**:直达模型库(多模型增删、文本 / 视觉 / 绘图 / 语音 / 视频能力多选、启用开关)。

工具调用可视化与对话气泡

  • Agent 执行任务时工具调用实时直播:每次调用以卡片逐条出现(工具名、参数、执行中动画 → 完成耗时 / 失败红字与错误详情),像看现场直播;完成后由最终消息的完整工具轨迹接管。
  • aiAgent 新增 onToolStart 回调(早于完成事件),主进程经 chat:tool IPC 推送到渲染进程(phase=start/done),runId 过滤防串台。
  • AI 回复改为气泡样式:卡片底色 + 左下尖角 + 标识头,与用户气泡对偶;带入场动画,错误气泡红色描边。

三层记忆与上下文压缩(架构参考 dsh-mnemon)

  • 新增 src/core/memory.ts:运行时记忆(用户画像 / 协作约定,常驻注入 system prompt)、长期事实(facts.jsonl 追加式存储,中文二元组 + 拉丁词相关性召回)、会话摘要三层。
  • 新增上下文压缩:历史超过预算(默认 24000 字符)时,旧轮次由模型浓缩为 ≤400 字摘要,只保留最近 8 条原文;摘要并入 system prompt 持续生效。无 AI 配置时降级为纯截断,绝不阻塞对话。
  • CLI 新增 cupbox memory add|search|list|stats|forget|user|collab 子命令。
  • MCP 新增 memory_remember / memory_recall / memory_manage / memory_profile 四个工具,工具总数 16 → 20;编排层 TOOL_DEFS 同步至 18(桌面 Agent 可直接调用记忆工具跨会话记事)。
  • 桌面版 chat:send 每次对话自动注入相关记忆;触发压缩时对话框显示「已压缩 N 条早前消息为摘要」提示条。
  • 修复 cupbox memory add <文本> --source <标签> 时标签值被误并入文本的解析问题。

多模型与项目工作流

  • 新增独立模型库与文本、视觉、绘图、语音、视频能力路由,多模型工作默认关闭。
  • 新增直接处理、顺序制作、并行大项目与审阅工作流;可指定参与项目制作的文本模型,分栏查看子项目真实进度。
  • 新增参考图片、媒体本地保存、子项目复制与失败重试、停止请求、Markdown 导出及草稿恢复。
  • 修正窗口最小化定位并新增 Ctrl+M。视频目前适配硅基流动协议。详见 docs/DESKTOP-MODELS.md。

模型连接与工具执行

  • 新增硅基流动、DeepSeek、GPT、Claude、OpenRouter、Ollama、LM Studio 和自定义服务预设,支持获取模型列表与连接测试,更换服务或地址不复用旧密钥。
  • 新增请求批准、智能批准、完全控制,以及文件沙箱 / 本机运行。手动工具和桌面 Agent 共用批准与执行边界。
  • 本地工具改为独立工作区,提供分类卡片、搜索、路径选择器、示例、输入与结果保留,以及结构化结果列表和表格。

桌面外观与启动体验

  • 新增可配置启动动画:光轨启程、风景开场、极简呼吸,以及本地 GIF、MP4、WebM 或图片素材;支持预览、开关、时长、文案、跳过和减少动态效果。
  • 扩展为 8 款内置主题:樱晴、绽放、月湖、花庭、极光、沙丘、水墨和纯色;新增分类筛选与配套界面色调,保留自定义背景。
  • 重新设计几何折叠盒 Logo,同步 SVG、PNG、ICO 与桌面窗口标识。
  • 统一 CLI、桌面和便携包版本号为 1.0.2。

测试

  • 用例 198 → 331 全绿,新增 12 个测试文件(freemodel、context、memory、paths、workbench、execution、model-workflow、chat-choice、workflow-scenes、response-context、filesystem-tools、workbench-http)。
  • 1.0.3 再增至 519 全绿(48 个测试文件),新增 19 个:announcement、computer、free-workflow、loopback-audit、plugins、ui-prompts 与 13 个 QQ 套件(bot、companion、conversation、emoji-delivery、emoji-import、meme-request、memory、roleplay、romance、security、service、streaming、whale-source)。

完整变更记录:v1.0.2...v1.0.3

English ## [1.0.3] - 2026-10-21 ### Main window close & tray (2026-10-21)
  • Closing the main window now asks whether to hide to the tray or quit, and states that the QQ bot keeps running in the background; quitting asks for confirmation and stops the QQ bot together with the app.
  • Added a system tray icon with show window, hide to tray and quit actions; when the tray is unavailable the close prompt only offers quit or cancel instead of pretending the window was hidden.

Startup announcement (2026-10-21)

  • Added announcement.json at the repository root: after the startup animation, Cupbox shows the announcement from GitHub with title, body, date and an optional link; the test announcement reads "欢迎使用 Cupbox 工具箱".
  • The announcement is checked once per launch; when its content (title / body / date / id) changes it is shown again even if the user previously chose "don't show again". With unchanged content, that checkbox keeps it hidden. Check failures stay silent.
  • Body text is rendered as plain text and links only allow https; use CUPBOX_ANNOUNCEMENT_URL to override the address or CUPBOX_ANNOUNCEMENT_DISABLE=1 to disable it. See docs/ANNOUNCEMENTS.md.

QQ bot (2026-10-21)

  • Added the "1021 character dialogue" build: rewrote the Whale-girl identity with tone examples separating in-character questions from real-person probing; the old shell-persona self-description is only skipped in model context, never deleted from original memories. Adds an optional one-off tool-free tone correction that checks first and then writes in segments, explicitly warning that it may add requests.

  • Added the "1021 meme direct-send" build tag (version stays 1.0.3) synced to the common portable directory; explicitly requesting any meme now performs the real send directly, distinguishing total gallery size from matched count so the model can no longer claim it cannot send images. Added 3 original transparent cat memes with preview, confirm-to-add/enable and duplicate protection.

  • Expanded to 14 built-in personas plus a custom option, with category/search/example cards; added sweet romance, slow-burn courtship, character positioning, forms of address, 4 story scenes and pacing. Courtship proposals cite original lines and archive after actual replies, isolated per account/session/user/persona/scenario, defaulting to private chat, with confirmed single-track reset.

  • Adapted companion chat inspired by Amadeus: layered personas, merged consecutive in-group messages, explicit silent/bulk interjection judgment scoped to groups, quiet skip vs direct-@ priority; added a preference profile backed by quoted evidence, time and memory tools, UI suggestion drafts and separate risk confirmations. Existing toggles are not auto-enabled; version stays at 1.0.3.

  • Added a session-scoped send_meme tool following dsh-meme's search/send/result-feedback flow, meaning-based image selection, free text-model compatibility, and real send results persisted with the conversation; the original keyword restriction is kept, failed sends are never retried, and turns with tools wait for results before emitting further segments.

  • Fixed over-reliance on model-chosen meme IDs for the send condition; added trigger-word hit auto-selection vs model-only judgment, single-character trigger words, the master toggle state, local condition checks, and manual testing after confirmation.

  • Added image decode normalization plus validation of QQ send return codes and message IDs; errors or unknown results are never resent automatically.

  • Added a real-time console: stage/level filters, search, pause, auto-scroll, error alerts, redacted copy and JSONL export; keeps a bounded in-memory log and by default never writes chat bodies, keys or image data.

  • Auto-memory persists to the system documents directory, supporting per-account global sharing or isolation per group/private chat; stopping, pausing or disabling auto-memory never deletes the files, with view, edit and confirm-before-delete.

  • Free models can join workflows and the experimental JSON tool-compat loop, with warnings about third-party data, rate limits and instability; local operations require per-action approval, format anomalies or execution failures stop immediately, keeping path and preview protections.

  • Redesigned the QQ space layout: compact connection area, local chat-pacing preview, on-demand advanced settings; added sidebar, page, toggle, bubble and dialog animations with reduced-motion adaptation.

  • Natural semantic segmentation replaces the default mechanical character truncation, keeping short replies, code and lists intact; a character-count compatibility option is retained. Added three chat expression strategies: casual, balanced, detailed.

  • Normal conversation memory is independent from bystander listening: already-triggered conversations are remembered by default while bystander listening stays off; group/private isolation and the temporary-memory lifecycle are preserved.

  • Redesigned setup steps, saved scopes and draft hints, distinguishing login from auto-reply; added risk confirmations for pause-now, enable, data sharing, context clearing and memory override.

  • Added all-groups / whitelist / blacklist plus a post-login checklist of real group lists; excluded groups collect no context, and legacy allowed group numbers migrate automatically.

  • Added configurable segmented streaming replies with inter-segment pacing and per-segment rate limiting; plain-text SSE streams as it generates, tool flows segment after completion, and stopped replies never resend already-sent segments.

  • Separated the submitted model message body from the QQ identity; history uses an independent identity field so QQ numbers never mix into message content.

  • Added a dedicated bot window hosting NapCat preparation, checks, auto-configuration, QR-code login and heartbeat reconnection, with no manual OneBot configuration required.

  • Group @/keywords, private chat and address terms, group-number scope, per-subsession context count and rate limits are all configurable; auto-reply and bystander listening default to off.

  • Reuses the model library and app-wide global memory, with independent chat/work mode, persona, temperature and effort-depth choices; search and image understanding can be disabled separately.

  • Custom meme meanings and trigger words send at most one image after backend verification; local file operations requested by the owner require per-action approval.

  • Version stays at 1.0.3; usage and upstream sources are documented in docs/QQ-BOT.md.

Windows installer

  • Added a complete offline installer, a Chinese branded welcome page, light/dark sakura wizard images, step hints, and a quick-start walkthrough.
  • Optional install location, Start-menu and desktop shortcuts; in-place upgrade and uninstall preserve user conversations and configuration, and no auto-start entry is added.
  • Added npm run pack:installer with SHA256 checksum output; the installer builds into its own staging directory and no longer clears the whole release folder. Version stays at 1.0.3.
  • Installation notes and the current code-signing status are documented in docs/WINDOWS-INSTALLER.md.

Free models, chat model picker & effort slider

  • Completed the free-model catalog refresh, the global toggle plus per-model toggles, minimal connection checks, and the "use in chat" entry; unavailable channels are never allowed through, and turning models off never silently switches providers.
  • The model button in the input box is now a searchable grouped menu for direct switching; added a model-aware effort slider with per-model memory that persists and restores per-session choices.
  • Effort maps to real OpenAI / DeepSeek / OpenRouter parameters; unknown models keep their defaults or accept an explicit override. Free requests never reuse paid API keys, and the cancellation signal is propagated into the network layer.
  • The interaction references dsh-codex-effort-slider, adapted independently to the existing desktop UI; reduced-motion remains respected and the version stays at 1.0.3. See docs/CHAT-MODELS-AND-EFFORT.md.

Feature illustrations & icon motion

  • Added four transparent feature illustrations used by the home quick actions, tool categories, search empty state, and model-collaboration guidance.
  • Settings, notifications, folder, tool and search icons respond to hover and keyboard focus; copying shows a brief checkmark, and sub-task icons reflect real run states.
  • Honors the system reduced-motion setting while keeping text feedback; no network-hosted icons or animation dependencies are introduced.
  • Assets and final prompts are documented in docs/FEATURE-VISUALS.md.

UI & risk interactions

  • Redesigned the default startup sequence with a new "sakura clear-window" illustration, keeping local custom media and reduced-motion support.
  • Added tiered notification cards and a notification center; errors are dismissed manually and informational prompts can be reviewed later.
  • Risk dialogs lead with consequences, targets and directories, with a checkbox required for high-risk actions; switching into full control or the native environment now requires an up-front explanation.
  • Unified the settings pages' hierarchy, type scale, cards and press feedback; the developer tools gained Chinese labels and empty states, and the command tool's stale allowlist form was corrected.
  • See docs/UI-EXPERIENCE.md for asset sources and the final prompts.

Dev-tool capability completion

  • The desktop Agent gained 36 dev-tool interfaces covering paginated file read/write, patch, backup & rollback, HTTP, diff/grep/replace, a real persistent ConPTY, processes/ports, image processing, Git, project script/test parsing, project memory/todos, context attribution, and the image clipboard.
  • Destructive file modifications default to preview and commit with a one-time token bound to the parameters and snapshot; out-of-repository paths and junction escapes are rejected.
  • Project policy proposals are never auto-trusted; Shell and terminal input require human approval even in full-control mode; domain authorization plus DNS pinning block SSRF.
  • Added the "Development & authorization" interface with structured results, preview-then-run buttons and policy editing. When long tool results are compacted, valid JSON and tokens are preserved.
  • See docs/WORKBENCH.md (security convergence and boundaries included).

Responses, feedback & scene workflows

  • Markdown is rendered with Marked and DOMPurify, with copy actions for the body, Markdown and code blocks; tool traces collapse and file tools show Chinese names.
  • Added helpful / inaccurate feedback that affects later reference and history filtering; long-term memories are saved only after explicit confirmation, can be edited and removed, and a negative rating revokes the stored memory and rebuilds the summary.
  • Added task scenes, automatic flow selection, dependency scheduling, upstream delivery hand-off, failure blocking, and optional acceptance / one-shot correction.
  • Reuses the official MCP Filesystem's 10 file capabilities; in execution mode sub-projects land in independent directories for the coordinating model to integrate, and writes still go through approval. The portable build ships the full production dependencies.
  • See docs/RESPONSES-AND-WORKFLOWS.md.

Context insight (capability direction inspired by dsh-context)

  • Added src/core/context.ts: fixed-density token estimation (≈1.5 chars/token for CJK, ≈4 for others), six-part breakdown (system prompt / tool schemas / user messages / injected context / assistant replies / tool results), capped trend points and events, compact token formatting.
  • Added CLI cupbox context [--text TEXT] [--file PATH] [--window 128000] [--json]: estimates text occupancy; with no text it returns the Agent baseline overhead (system prompt + all tool schemas).
  • Added MCP tool context_stats (read-only) — tool count 20 → 21; orchestration layer TOOL_DEFS now has 19 entries.
  • AI calls now capture provider-reported usage: aiChat reads Anthropic input_tokens/output_tokens and OpenAI prompt_tokens/completion_tokens; aiAgent accumulates them across the loop and returns the request count.
  • Desktop: each turn stores the breakdown, occupancy trend (including real in/out tokens) and four event kinds (inject / compact / model switch / mode switch) in the session record; a new "Context" button in the chat header opens an insight panel with KPIs, a stacked composition bar, a per-request trend chart and the event feed. CUPBOX_CONTEXT_WINDOW adjusts the window size.
  • Estimates are heuristic (≈), not exact tokenizer counts, meant as a rough occupancy reference.

Earlier updates in the same version (2026-10-19)

Storage & model management

  • Data now lives in your OS Documents folder (Documents/Cupbox) — config, API keys, model library, sessions and memory. On first launch the legacy ~/.cupbox is migrated automatically: copy-only (never deletes), never overwrites a non-empty target, and failures are silent so startup is never blocked. CUPBOX_HOME still overrides everything (portable / test isolation).
  • Added src/core/paths.ts as the single source of truth for the data directory (same semantics across CLI / MCP / desktop); both the CLI main and startMcpServer migrate on startup.
  • Settings → Model connection now has an API storage card: shows the current data directory with one-click "open storage folder" and "reveal config.json".
  • Added a Model management entry in the sidebar that jumps straight to the model library (add/remove multiple models, capability multi-select for text / vision / image / audio / video, per-model enable toggle).

Live tool-call visualization & chat bubbles

  • While the agent executes a task, tool calls stream live as cards — tool name, arguments, an "executing" animation, then completion time or a red failure line with the error detail; the final message's full trace takes over afterwards.
  • aiAgent gained an onToolStart callback (fires before completion); the main process pushes chat:tool IPC events (phase=start/done) to the renderer, filtered by runId.
  • Assistant replies are now bubbles: card surface with a bottom-left tail and a header, mirroring the user bubble, with an entrance animation and a red-outlined error bubble.

Three-tier memory & context compaction (architecture inspired by dsh-mnemon)

  • Added src/core/memory.ts: runtime memory (user profile & working agreements, always injected into the system prompt), long-term facts (facts.jsonl, relevance-recalled via CJK bigrams + Latin tokens), and session summaries.
  • Added context compaction: when history exceeds the budget (24 000 characters by default) older turns are distilled by the model into a ≤400-character summary, keeping only the last 8 messages verbatim. The summary is merged into the system prompt and carries forward. Without an AI configuration it degrades to plain truncation and never blocks the chat.
  • Added the CLI subcommand cupbox memory add|search|list|stats|forget|user|collab.
  • Added four MCP tools — memory_remember / memory_recall / memory_manage / memory_profile — bringing the MCP tool count 16 → 20; the toolkit layer TOOL_DEFS is now 18 so the desktop agent can remember things across sessions.
  • Desktop chat:send now auto-injects relevant memories into every conversation and shows a "compacted N earlier messages" chip when compaction triggers.
  • Fixed cupbox memory add <text> --source <tag> parsing where the tag value leaked into the text.

Multi-model & project workflows

  • Added independent model profiles and text, vision, image, speech and video routing; multi-model mode is off by default.
  • Added direct handling, sequential production, parallel large-project and review workflows with explicit worker selection and progress panes showing each sub-project's real progress.
  • Added reference images, local media persistence, sub-project duplication with failure retries, stop requests, Markdown export and draft recovery.
  • Fixed window-minimize positioning and added Ctrl+M. Video currently uses the SiliconFlow submit/status protocol. See docs/DESKTOP-MODELS.md.

Model connections and tool execution

  • Added provider presets for SiliconFlow, DeepSeek, GPT, Claude, OpenRouter, Ollama, LM Studio and custom endpoints, with model listing and connection checks; changing the provider or address never reuses old credentials.
  • Added request approval, smart approval and full control, plus a file sandbox / native execution mode, shared by manual tools and the desktop Agent.
  • Replaced the tool drawer with a dedicated workspace featuring category cards, search, path pickers, examples, retained inputs and results, and structured result lists and tables.

Desktop appearance and startup

  • Added configurable startup animations: light-track departure, scenic opening, minimal breathing, plus local GIF, MP4, WebM or image media; with preview, toggle, duration, caption, skip controls and reduced-motion support.
  • Expanded to eight built-in themes — Sakura Clear, Bloom, Moon Lake, Flower Garden, Aurora, Dunes, Ink and Solid — with category filters and matching interface tones, while retaining custom backgrounds.
  • Redesigned the geometric folded-box logo, synchronized across SVG, PNG, ICO and the desktop window icon.
  • Aligned the CLI, desktop and portable package versions at 1.0.2.

Testing

  • 198 → 331 test cases, all green, with 12 new test files (freemodel, context, memory, paths, workbench, execution, model-workflow, chat-choice, workflow-scenes, response-context, filesystem-tools, workbench-http).
  • 1.0.3 grows again to 519 test cases across 48 files, all green, adding 19 more: announcement, computer, free-workflow, loopback-audit, plugins, ui-prompts and 13 QQ suites (bot, companion, conversation, emoji-delivery, emoji-import, meme-request, memory, roleplay, romance, security, service, streaming, whale-source).

Full Changelog: v1.0.2...v1.0.3