mail.send 工具契约 2.0.0(to 数组 / html / 附件 / inReplyTo / dryRun;保留 v1 的 body 与 queued);契约快照刷新,五道门禁绿

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TM4kUBvekALu9qqmp7D3wr
This commit is contained in:
xcs
2026-08-26 02:23:24 +08:00
co-authored by Claude Fable 5
parent b6ec37a231
commit e0fc16db33
10 changed files with 1340 additions and 8 deletions
@@ -138,3 +138,20 @@ describe('staticAudit —— 注册两审之静态审', () => {
expect(auditPassed(findings)).toBe(true);
});
});
describe('mail.send 2.0.0 的演进', () => {
it('保留 v1 的 body / queued、不新增必填 —— 演进检查零违规', () => {
const v1 = {
name: 'mail.send', displayName: '发送邮件', version: '1.0.0', description: '发出邮件(报价单 / 询价函 / 催办)',
input: { type: 'object', required: ['to', 'subject'], properties: { to: { type: 'string' }, subject: { type: 'string' }, body: { type: 'string' } } },
output: { type: 'object', properties: { queued: { type: 'boolean' } } },
effect: 'write' as const, errors: [], idempotent: true, timeoutMs: 10_000, retries: 2, connectionKeys: ['endpoint'],
};
const v2 = {
...v1, version: '2.0.0', connectionKeys: ['account'],
input: { type: 'object', required: ['to', 'subject'], properties: { ...v1.input.properties, to: { type: 'array', items: { type: 'string' } }, html: { type: 'string' }, dryRun: { type: 'boolean' } } },
output: { type: 'object', properties: { ...v1.output.properties, outboundId: { type: 'string' }, state: { type: 'string' } } },
};
expect(checkEvolution(v1, v2)).toEqual([]);
});
});