refactor: clean CLI taxonomy — canonical subcommands, merged memory.update, no aliases

- calendar: split write → create/read/update/delete/share
- contacts: rename lookup → read
- memory: merge write+forget → update (unified action field in operations)
- Remove all alias/normalization logic from adapter and handlers
- Update tool_postprocessor ui_hints builders to canonical keys
- Remove frontend legacy TOOL_CALL_START/ARGS/END events and ToolCallItem
- Update SKILL.md files and protocol docs
- Update tests and settings screens
This commit is contained in:
qzl
2026-04-23 12:12:41 +08:00
parent 91077a933d
commit 19e273a9e6
48 changed files with 1578 additions and 811 deletions
+29 -18
View File
@@ -16,32 +16,43 @@ class _FakeMessage:
self.timestamp = datetime.now(timezone.utc)
def test_convert_message_to_history_does_not_attach_ui_schema_for_tool_message() -> (
None
):
def test_convert_message_to_history_attaches_ui_schema_for_tool_message() -> None:
message = _FakeMessage(
role="tool",
metadata={"tool_agent_output": {"result": "done"}},
)
result = convert_message_to_history(message) # type: ignore[arg-type]
assert "ui_schema" not in result
assert "uiSchema" not in result
def test_convert_message_to_history_does_not_attach_ui_schema_for_assistant_message() -> None:
message = _FakeMessage(
role="assistant",
metadata={
"agent_output": {"ui_schema": {"version": "2.0", "root": {"type": "stack"}}}
"tool_agent_output": {
"result": {"status": "success"},
"ui_hints": {
"intent": "status",
"status": "success",
"title": "完成",
"items": [],
"listItems": [],
"sections": [],
"actions": [],
},
}
},
)
result = convert_message_to_history(message) # type: ignore[arg-type]
assert "ui_schema" not in result
assert "uiSchema" not in result
assert "ui_schema" in result
def test_convert_message_to_history_adds_suggested_actions_for_assistant_message() -> None:
message = _FakeMessage(
role="assistant",
metadata={
"agent_output": {
"suggested_actions": ["查今天日程", "创建会议"]
}
},
)
result = convert_message_to_history(message) # type: ignore[arg-type]
assert result["suggestedActions"] == ["查今天日程", "创建会议"]
def test_convert_message_to_history_returns_multiple_user_attachments() -> None: