Commit Graph

5 Commits

Author SHA1 Message Date
362f800bd2 feat(mail-operations): 补充标记为垃圾邮件 / 不是垃圾邮件接口(1.1.0) (#208)
## 变更 / Changes

mail-operations 1.0.6 → 1.1.0:补充客户端新增的「标记为垃圾邮件 / 不是垃圾邮件」接口。
Adds the client's new mark-as-junk / not-junk endpoints to
mail-operations (1.0.6 → 1.1.0).

- 「单封邮件操作」表新增两行:Gmail、IMAP 用 `POST …/{id}/spam`、`…/not-spam`,Outlook 用
`POST /outlook/message/spam?id=`、`…/not-spam?id=`。
  Two rows in the single-message table.
- 补充使用说明:返回 `result: {id, folder}`;Outlook、IMAP 移动后 `id` 会变;IMAP
没有垃圾邮件文件夹时返回 409
`imap_spam_folder_not_found`,不要重试;「不是垃圾邮件」一次一封;移回收件箱不触发规则。
Usage notes: new id after Outlook/IMAP moves, 409 when an IMAP account
has no junk folder, Not junk one at a time, no rule re-trigger.
- `market.required_client_version` 与 sidecar 的
`compatibility.requiredClientVersion` 同步改为
`10.0.178`。内置技能同步会按它拦截,旧客户端继续使用 1.0.6,不会拿到调用后返回 404 的接口说明。
  Client gate raised to 10.0.178 so older clients keep 1.0.6.
- 中文是源语言;英文译文(`translated_by: human`)已人工同步,`source_hash` 用
`translate.py` 的 `compute_source_hash` 重新计算。
zh-CN source and human en-US translation updated together; `source_hash`
recomputed with the repository's own function.

## 合并时机 / Merge timing

客户端实现在 desirecore/desirecore#4205,它依赖 desirecore/desirecore#4195。**请在
#4205 合入、确认随 10.0.178 发布之后再合并本 PR。** 如果实际发布的版本号不是 10.0.178,先把两处
`required_client_version` 改成实际版本再合并。合并后,客户端仓库需要运行 `npm run sync-market`
刷新内置的 `market.zip`。

The client side is desirecore/desirecore#4205 (depends on #4195). Merge
this after #4205 lands and ships in 10.0.178; adjust both version gates
if the release number differs. Afterwards regenerate the client's
bundled `market.zip` with `npm run sync-market`.

## 校验 / Checks

- `validate-i18n.py`:0 error,123 warning(与改动前相同;mail-operations 的两条
license / review evidence 警告原来就有)。
- `validate_catalog_metadata.py --require-complete`:0 error。
- `translate.py --check skills/mail-operations`:en-US 为
human-locked,与源一致。
-
公开信息检查:改动内容只有通用的接口说明,不含任何租户、客户或合作方信息。**未用私有敏感词清单做全量扫描**:本次没有拿到这份清单,合并前请维护者补跑一次。
Public-information review: generic API text only. The private-token scan
was not run because the token list was not available; please run it
before merging.
2026-10-06 13:22:17 +08:00
74184056c4 fix(mail-operations): 按现行邮件服务路由修正技能文档(1.0.6) (#194)
## 背景 / Background

发票整理 Agent 在隔离开发实例里真机整理 QQ 邮箱时,按内置技能 `mail-operations` 的写法调用 IMAP
附件下载,拿到 400 `Missing required parameters`:技能写的请求体是 `{email, uid, folder,
partId}`,而 `POST /imap/attachment` 从 2026-03 创建起就只认 `{email, messageId,
attachmentId, folder?}`。顺着这一处,对照 desirecore origin/dev(`c1e2c5ac0`)的
`lib/mail-service/` 与 `MailOperations` 工具把整份技能逐条核对了一遍。

While a real-mailbox run of the invoice agent was downloading QQ Mail
attachments, the builtin `mail-operations` skill's IMAP attachment body
(`{email, uid, folder, partId}`) returned 400; the route has always
taken `{email, messageId, attachmentId, folder?}`. This PR re-audits the
whole skill against the current mail service routes.

## 改动 / Changes

共修正 27 处不一致:会直接导致调用失败 9 处、会误导能力判断 10 处、措辞 8 处。主要有:

- **调用入口**:改为 `MailOperations`(path 带 `/api`,capability
由工具注入);原文的固定端口、「无需认证」、`curl -k` 都不成立
- **附件**:body 字段更正;必须带 `save_to` 落盘(不带会被工具拒绝返回),回执给出路径、字节数、SHA-256
- **参数位置**:`messages/fetch`、`/sync`、IMAP 草稿发送的 `email`(以及 `/sync` 的
`provider`)放查询串;IMAP 草稿收件人是逗号分隔的 `to` / `cc`,更新草稿会换成新 uid
- **folder**:IMAP 单封操作要用 `GET /imap/folders` 返回的服务器路径,列表里的归一化值会 500
- **规则**:operator 是 `matches_regex`(未知 operator 恒为 false
且创建时不校验);`archive` / `move_to_folder` / `forward_to` / `star` 是空操作
- **搜索**:三个 provider 都支持,只查本地缓存、`q` 只匹配主题;Gmail 全文检索改用 `messages/fetch`
的 `query`
- **IMAP 仅收信账户**:`allowUnverifiedSmtp`、`smtp_verification_failed`、409
`smtp_unverified`、`verify-smtp`(失败也返回 200)
- **离线队列**:不会自动入队或处理,只改本地,`processed` 计数不代表执行
- 响应字段名(`toRecipients`、`bodyPreview` 等)、同步状态文件、`/imap/test` 返回形态等措辞修正
- 版本 1.0.6;新增 `market.required_client_version: 10.0.148` 与 sidecar
`compatibility.requiredClientVersion`——`MailOperations`(10.0.95)、`save_to`
与 Outlook/IMAP search(10.0.146)、`imap:<uid>` / fetch `offset` / folder
归一化(10.0.148)分版本上线,旧客户端按新文档操作会静默失败,门控让它们保留旧版

## 验证 / Verification

- 写补丁与审查由两个独立子代理完成:审查方对 9 处致命项全部、另外 13 处抽查逐条对照代码行,均成立;审查意见(最低客户端版本、IMAP
更新草稿换 uid、`/sync` 参数、Gmail 远程检索、`verify-smtp` 返回形态、离线队列计数、响应示例矛盾)已全部采纳
- 各项最低版本用 `git tag --contains` 对照发布 tag 复核
- `translate.py --check`:en-US human-locked 且 hash 新鲜(`source_hash` 按
`compute_source_hash` 重算)
- `validate-i18n`:0 error,123 warning(与 main 基线相同)
- `validate_catalog_metadata --require-complete`:0 error
- `git diff --check` 通过;新增行只有 `example.com` 占位地址,无真实邮箱、姓名、公司名或长数字编号

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-09-29 05:07:39 -04:00
xyx
3301913a9f feat(mail-operations): 补充邮箱服务 UI 入口说明 v1.0.4 (#30)
## Summary / 摘要

- Add "How to Access the Email Service" section to `SKILL.md` and
`SKILL.zh-CN.md`, guiding users to navigate via Resource Explorer →
Emails card
- 在中英文技能文件中新增「如何进入邮箱服务」章节,说明通过资源管理器→邮箱卡片进入邮箱管理界面

## Changes / 变更

- `skills/mail-operations/SKILL.md`: add "How to Access the Email
Service" section, version 1.0.3 → 1.0.4
- `skills/mail-operations/SKILL.zh-CN.md`: add「如何进入邮箱服务」章节
- `manifest.json`: version 1.2.5 → 1.2.6
2026-06-20 11:30:56 +08:00
xyx
eab5c824a5 fix: replace hardcoded ~/.desirecore paths with ${DESIRECORE_ROOT} variable (#16)
## Summary

- 将所有技能文件中的硬编码 `~/.desirecore/` 和 `$HOME/.desirecore/` 路径替换为
`${DESIRECORE_ROOT}/` 变量
- 递增 manifest.json version 至 1.2.1

## Why

dev 模式下 `DESIRECORE_HOME=~/.desirecore-dev`,硬编码路径导致技能读取错误的端口文件和目录。主仓库的
`variable-substitutor.ts` 会在运行时将 `${DESIRECORE_ROOT}` 替换为实际根目录。

## Test plan

- [ ] `npm run dev` 启动后触发任意技能,确认端口路径解析为
`~/.desirecore-dev/agent-service.port`
- [ ] prod 模式确认路径为 `~/.desirecore/agent-service.port`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-29 15:36:19 +08:00
8bdda4afb1 feat: skills i18n 改造(schemaVersion 1.1,零向后兼容) (#1)
* feat: skills i18n 改造 — schemaVersion 1.1,零向后兼容

把 21 个 skills + 1 个 agent + manifest/categories 全量迁移到 schemaVersion 1.1
的 i18n 结构,配套 CI AI 翻译流水线(GitHub Models)与本地工具链。

## 关键变更

### 数据结构(破坏性,schemaVersion 1.0 → 1.1)
- SKILL.md: 顶层 name 改为 ASCII slug(== 目录名,符合 agentskills.io 规范);
  中文显示名/short_desc/description 全部迁入 metadata.i18n.<locale>
- agents/<id>/agent.json: shortDesc/fullDesc/tags/persona.{role,traits} 迁入
  i18n.<locale>;changelog[].changes 改为 { <locale>: string[] } 对象
- categories.json: 每个分类的 label/description 迁入 i18n.<locale>,顶层只剩
  color/icon
- manifest.json: 加 supportedLocales / defaultLocale;顶层 description 迁入
  i18n.<locale>

### Body 文件结构
- 根 SKILL.md = frontmatter + default_locale (en-US) body
- SKILL.<locale>.md = 各 locale 的 markdown body(首行 <!-- locale: xx --> 自校验)

### 工具链(scripts/i18n/)
- glossary.json: zh→en 术语表 + do_not_translate 白名单
- schema/skill-frontmatter.schema.json: i18n frontmatter JSON Schema
- validate-i18n.py: 8 条校验规则(name 合规 / locale 完整性 / hash 一致性等)
- translate.py: GitHub Models / Anthropic 双 backend,sha256 增量翻译
- migrate.py: 一次性迁移脚本(旧格式 → i18n 结构)

### CI(.github/workflows/)
- i18n-validate.yml: PR 触发跑 validate + translate --check
- i18n-translate.yml: PR 触发用 GitHub Models(默认 openai/gpt-5-mini)翻译缺失
  locale,自动追加 commit;可切到 ANTHROPIC_API_KEY 走 Claude

### 文档
- docs/I18N.md: 作者贡献指南(schema 说明 / 提交流程 / 常见问题)
- README.md: 加多语言段落

## 验证

- uv run scripts/i18n/validate-i18n.py: OK,49 文件 0 错误
- uv run scripts/i18n/translate.py --check: 0 stale locale
- 21 skills 标题数 zh-CN == en-US 严格对齐(最大 66=66)
- skills-ref 规范校验:全部通过(顶层 name ASCII slug + description 单字段)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(i18n): 修复 PR #1 review 反馈的 6 项问题

- schema: translated_by 正则放宽为 ^(human|ai:[A-Za-z0-9._:/-]+)$,接受
  'ai:github:openai/gpt-5-mini' 这类 backend:model 形式(CI 翻译输出格式)
- README + docs/I18N.md: 修正"CI 用 Claude API"误导描述,正确说明默认是
  GitHub Models(openai/gpt-5-mini)+ GITHUB_TOKEN,可选切到 Anthropic
- skills/minimax-tts/SKILL.md & SKILL.zh-CN.md: 删除多余的 ``` 闭合,避免
  Markdown 后续渲染错乱
- skills/docx/SKILL.md: 翻译时丢失的 • Unicode escape 示例已恢复,
  与 zh-CN 版本对齐

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 00:26:33 +08:00