Repository navigation
feat(desktop-pet): 用原气泡显示工作状态,对话优先 - #82
Merged
Merged
Conversation
- 合入 main:outputTap 保留 main 的 externalizes: () => false(桌宠可被打断依赖它);
main 上对话页已占用的 activity 字段不动,状态追踪器改名为 src/status.ts 的 StatusTracker。
- 开始与结束交给 Core 的 RunPhase(onRunPhase):请求模型、重试、交接时是思考,新一轮从思考开始,
idle 收起。去掉 120 秒无流事件清空的计时器和 onRoundEnd/onAbort/onTurnEnded 的推断。
outputTap 只读工具调用的名字和参数。
- 工具名到文案的表从 World 包移到 Coopanion 的 core/pet-status.ts,经 desktopPetDefinition({ describeTool })
传入;World 只保留 pet_* 不显示、其余未描述的工具显示「在忙」。依赖参数的文案(在点/在双击/在右键)
等参数写完再定。
- 状态气泡关闭时,自动思考照常画思考小圆泡:kit 的身体新收 set({ thoughtShown })。
- 测试随之改写:描述表的用例移到 tests/pet-status-tools.test.ts,追踪器按运行阶段测;去掉 120 秒用例。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
谢谢 @leafliber!气泡的样子、图标动画、对话优先和显示节奏都照原样保留。合并前追加了一个提交 15c28a7,改的是数据层:
会随下一个版本发布。 |
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.
Coo 干活时原来只剩一个思考表情,读文件、搜索、操作电脑都看不出在做什么;现在默认用原来的气泡显示工作状态,对话始终优先,可在「习惯」里关闭。
信号从哪来
outputTap,包括其他 World 和 Persona 的工具调用,不改 Cortico 和core/companion.ts。src/activity.ts:用item.id/item_id和到达顺序跟踪调用,避开重复的output_index;参数里的字符串一闭合就能显示细节,不等完整正文或done。onRoundEnd保留状态,下一轮首个事件才切回思考;onAbort、onTurnEnded或 120 秒无流事件时清空。{ t: 'status', status },init/prefs带当前状态和开关,状态变化不会触发偏好广播。每类长什么样
read_filelist_files/glob_files/(未给目录时为「记忆」)/ 在找 · 匹配模式grep_fileswrite_file/edit_file/append_filedelete_filesave_blobcua_screenshot/cua_windowscua_click/cua_move/cua_drag/cua_scroll/cua_focuscua_type/cua_keycua_waitalarm_set/alarm_list/alarm_cancelpet_*/terminal_send/end_turn路径只露出最后一段,细节最多 20 字再加省略号;打字内容、闹钟备注、窗口标题和坐标不会出现在状态中。图标沿用 24 单位描边和主题变量,不加声音,并遵循减少动态效果设置。
节奏与位置
pointer-events: none,并从交互气泡命中选择器中排除,避免接管那块屏幕的点击。显示对话时恢复原来的交互。设置
worlds.desktop-pet.statusBubble默认开启,支持热更新。关闭时 World 仍发送状态,身体的思考表情照常。pet_set,不加入统计。同步更新中英文首页和桌宠包 README,包括页面协议。这次不做的
core/companion.ts。ENV_PROMPT。验证
f180d2f,执行过pnpm install --frozen-lockfile;本 PR 不含子模块变更。pnpm run test:57 项通过,包含默认开启、开关即时生效、思考去重、延迟与停留时间、对话优先和同一气泡复用。pnpm run test:worlds:148 项通过,1 项真实 Windows 语音识别测试在 macOS 按平台跳过。覆盖工具映射、参数增量、隐私、调用合并、迟到的 done、无 created 的下一轮、中止、结束、超时、状态消息及重连。pnpm run typecheck通过。pnpm run build:cortico后执行pnpm run typecheck:web,均通过。pnpm run typecheck:worlds通过。window.enabled=false的 DesktopPetWorld 在内置浏览器演示并截图检查了各类图标和动画、连续读文件计数、慢速写文件的文件名提前出现、深浅两套主题、完整齿轮、思考不重复、对话和输入框优先、关闭气泡保留思考表情,以及 180 毫秒秒回时思考气泡不闪。最终页面只有一个气泡;状态区域的 DOM 命中落到下方 stage。临时演示文件已删除,截图不提交。pnpm run dev并启动应用,但原生 Electron 窗口的界面自动化持续超时。未验证真实透明窗口跨应用的点击穿透,也未用真实模型读记忆文件跑一轮;没有读取、打印或填写密钥。