feat(console): 对话输入器加 restore,图标表加 message - #182
Merged
Merged
Conversation
页面撤回一条还没送出的消息、或从别处带着草稿打开时,需要把内容放回输入框继续编辑。 restore(text, images) 把文字接在已有内容之前(空一行隔开),已归一化的图片放进托盘, 超出张数上限的部分不放并给出提示;不提交。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
页面的左栏图标只能从 ConsoleIconName 里选;对话一类的页面没有可用的图标,只能借 terminal。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
Phantivia
added a commit
to Pal-AI-Lab/Coopanion
that referenced
this pull request
Oct 6, 2026
* feat(cua): 工具可被 interrupt 打断,停在不留半截输入的地方并报告已做的部分
- 十个工具都声明 interruptible,handler 收到 ctx.signal。等使用者回答授权时
直接返回不执行(问题仍开着,回答对本轮之后的调用有效);等使用者停手时
不发输入;cua_type 停在两段之间并报告打出几个字符;cua_wait 报告等了几秒;
已发出的输入跳过 settle 和截图。
- 引擎协议加 { cancel: id }:引擎只在等使用者停手和打字段间响应,点击、
拖动、滚动、按键序列、切窗口一旦开始就发完,拖动不会留着左键。
- 打字改按 16 个字形一段发送,停下时不拆开多码位的字。
- 需要 Cortico 带 ToolDef.interruptible 的版本才会收到 interrupt;旧版本上
signal 只在关机时触发。
- 测试:cua_wait 被打断时提前返回且不截图;cua_type 打断时向引擎发 cancel,
回执按引擎报告的字数写。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(desktop-pet): 对话页通道:以使用者身份收发,记下桌宠说过的话与做过的事
- 新增 chat 面板的推送连接(src/chat.ts):对话页发来的文字与图片作为 [打字] 事件以
preempt 投递;送达前在页面上排队,可以 interrupt 立即送达或撤回(WorldHost
promotePending / withdrawPending);onEventsSettled 告诉页面何时送达。
- pet_say 的每一拍、pet_ask 的问题、两句话之间调用过的工具名记为 desktop-pet.self 事件,
只落库不投递,页面据此还原历史;排过队的消息记下送达位置,历史按 bot 实际看到的顺序排。
- pet_ask 在对话页也能回答,回答后桌宠上的气泡关掉;桌宠气泡的回答也同步到页面。
- pet_walk_to 可被 interrupt:页面经 figure-frame 调身体的 stopWalk(id)(形象契约里的可选方法,
kit 已实现),停在原地,回执写停在哪里。
- 气泡里打字的消息也改为 preempt;outputTap 声明 externalizes 恒为 false(桌宠不显示
模型输出流本身,工具执行时才有外部效果)。
- 桌宠打字气泡加展开钮(应用提供 openChat 时显示),带着草稿打开对话页。
- 环境提示词按应用是否提供对话页加一段 {{pet.chat}};pet_say、pet_ask 的回执在对话页
开着时说明内容也显示在那里。
- README 加「对话页」一节,写推送连接的帧、desktop-pet.self 记录与 openChat。
- 测试:对话页消息以 preempt 发出、送达前排队、撤回后不进历史;interrupt 让走路停下并
回报位置。FakeHost 的 deliver:false 事件另记 stored,不计入 events。
需要 Cortico 带 interrupt、RunPhase 与 onEventsSettled 的版本(Pal-AI-Lab/Cortico#180、#181)。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(core): 桌宠打字气泡的展开钮打开设置窗口的对话页
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(console): 普通模式的「对话」换成对话页,终端页改名「运行轨迹」放进高级组
- 对话页(features/chat)接桌宠 World 的 chat 面板:以使用者身份打字、发图;桌宠的话画成
与桌宠相同的描边气泡,一拍一个,尖角朝左;提问显示为桌宠的提问气泡,可以在这里回答;
两句话之间做过的事折叠成一行小字,只列认得出的工具。
- 送达前的消息排在输入框上方,每条可以「立即发送」(打断当前这一步)或「撤回」(退回输入框)。
- 顶栏按 Core 的运行阶段显示空闲、在想、正在做什么、重试、已暂停;「运行轨迹」进高级模式的
原始时间线。
- 上游的终端页(以「控制台」身份发内部消息、显示原始 session)改名「运行轨迹」,放进「高级」组。
需要 Cortico 的 promptInput.restore 与 message 图标(Pal-AI-Lab/Cortico#182)。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: vendor/cortico 升到 Cortico main(#180–#183)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(console): 对话页重绘时保留提问的自写回答草稿、焦点与步骤展开状态;走路结束后移除 abort 监听
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <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.
改动
ConsolePromptInput新增restore(text, images?):把文字接在输入框已有内容之前(空一行隔开),已归一化的图片放进托盘,超出张数上限的部分不放并显示「最多 N 张」的提示;不提交。用途:Coopanion 的对话页里,用户撤回一条还在排队的消息时把它放回输入框;从桌宠气泡「展开」到对话页时带上草稿。现有接口只有 focus、setDisabled、setPlaceholder,页面没法往输入框里放内容。
图标表加
message(对话气泡):对话一类的页面原先只能借terminal图标。pnpm run typecheck、pnpm typecheck:web通过。English
Also adds a
message(speech bubble) icon, so chat-like pages need not borrowterminal.Adds
restore(text, images?)to the console's prompt input: the text goes before what is already typed, normalized images go into the tray up to the limit, nothing is submitted. Coopanion's chat page uses it to put a withdrawn queued message back into the composer and to open with a draft carried over from the pet's bubble.🤖 Generated with Claude Code