# 1. 缺 .d.ts 导致构建失败(上一提交引入)
`lib/attachment-ids.js` 是上一提交新增的共用库,但没配 `.d.ts`。dsh 桥走
TypeScript 编译,于是:
src/index.ts(65,40): error TS7016: Could not find a declaration file for
module '../lib/attachment-ids.js'
pi 与 opencode 不做类型检查,所以只有 dsh 会在这里红 —— 很容易被当成偶发放过。
补上声明,类型刻意写成 `unknown`:这个函数的全部意义就是接收**不可靠的输入**,
用 `string[]` 收窄签名会让人误以为调用方本来就该给对形状。
# 2. 测试从 dist/ 导入,却不先构建 → 可以测到改动前的旧产物
dsh 的测试有两类导入:`../lib/*.js`(直连源码)与 `../dist/index.js`(编译产物)。
test 脚本原本是纯 `node --test`,**不先构建**。于是「改 src → npm test 全绿」
完全可能只验证了旧 dist —— 实测就踩到了:提交前那次 361 通过跑的是改动前的产物,
`lib` 本身有覆盖(attachment-ids.test.mjs 直连 lib),但**入口的接线没被测到**。
加 `pretest: tsc -p tsconfig.json`(npm 会在 test 前自动执行)。
反向验证:往 src 注入一个类型错误后 `npm test` **EXIT=2**(构建先失败),
而不是拿旧 dist 蒙过去;恢复后 361 通过 / 0 失败。
28 lines
646 B
JSON
28 lines
646 B
JSON
{
|
|
"name": "dsh-mail-bridge",
|
|
"version": "0.1.0",
|
|
"description": "DeepSeek Harness plugin: AgentMail 邮件驱动多智能体协作平台桥接",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"types": "dist/index.d.ts",
|
|
"dsh": {
|
|
"bundle": {
|
|
"patch": "./cordis.patch.yml"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"verify": "tsc --noEmit",
|
|
"pretest": "tsc -p tsconfig.json",
|
|
"test": "node --test 'test/*.test.mjs'"
|
|
},
|
|
"peerDependencies": {
|
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
"@deepseek-ai/dsh-tools": "^0.1.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^22.0.0",
|
|
"typescript": "^6.0.3"
|
|
}
|
|
}
|