feat(office): Office 技能目录只保留 office,格式指导改为按需读取的资源文件

docx、pptx、xlsx 的指导从独立技能移到 office 技能目录下的 docx.md、
pptx.md、xlsx.md,模型加载 office 后用 read 按需读取;tool-office 的
activationSkills 默认值改为 office。
This commit is contained in:
yudshj committed 2026-11-20 23:27:24 +08:00
1 parent 97db571e72
commit 7f8e3720b8
51 files changed
+769 -357

No files matched your search

+5 -5
View File
@@ -972,9 +972,9 @@ def _smoke_sdk_authoring_cached(base_url: str, executable: Path, update_snapshot
root = Path(temporary).resolve()
home = root / "home"
if mode == "replacement":
skill = home / "skills/office-docx/SKILL.md"
skill = home / "skills/office/SKILL.md"
skill.parent.mkdir(parents=True)
skill.write_text("---\nname: office-docx\ndescription: CUSTOM_OFFICE_DOCX\n---\nUse the bundled Python for custom document work.\n")
skill.write_text("---\nname: office\ndescription: CUSTOM_OFFICE\n---\nUse the bundled Python for custom document work.\n")
patch = root / "skills.patch.yml"
# Fix the model-visible clock in this child only; native timers stay live.
patch_rows = [
@@ -1000,9 +1000,9 @@ def _smoke_sdk_authoring_cached(base_url: str, executable: Path, update_snapshot
assert len(requests) == 2, requests
prompt = json.dumps(requests[0], ensure_ascii=False)
assert ("- `office`:" in prompt) == (mode != "disabled"), mode
for name in ("office-docx", "office-pptx", "office-xlsx"):
assert (name in prompt) == (mode != "disabled"), (mode, name)
assert ("CUSTOM_OFFICE_DOCX" in prompt) == (mode == "replacement"), mode
assert not re.search(r"office-(?:docx|pptx|xlsx)", prompt), mode
assert ("Word, PowerPoint, and Excel" in prompt) == (mode == "default"), mode
assert ("CUSTOM_OFFICE" in prompt) == (mode == "replacement"), mode
tool_result = next(block for message in requests[1]["messages"]
for block in message.get("content", [])
if isinstance(block, dict) and block.get("tool_use_id") == "authoring-runtime")