dsh-vault 1.5.0 → 1.6.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-zh.md +10 -1
- package/README.md +10 -1
- package/lib/client.js +553 -314
- package/lib/client.js.map +1 -1
- package/lib/imports.js +72 -1
- package/lib/index.js +610 -85
- package/lib/store.js +70 -1
- package/lib/urlmatch.js +94 -0
- package/lib/watchtower.js +137 -0
- package/lib/zip.js +53 -0
- package/package.json +1 -1
package/README-zh.md
CHANGED
|
@@ -51,17 +51,24 @@ dsh-vault 是一个面向 DeepSeek Harness 的安全加密插件:把你在使
|
|
|
51
51
|
| `vault_totp` | 为存储的 otpSecret(或直接传入的 Base32/otpauth URI)生成当前 6 位动态验证码 |
|
|
52
52
|
| `vault_generate_password` | 生成强随机密码(长度/字符集/分组可选)**或易记口令短语**(`passphrase: true`,EFF 词表,`words`/`separator`/`wordDigits`) |
|
|
53
53
|
| `vault_strength` | 零依赖密码强度评估(0–100 分,weak/fair/strong/very strong) |
|
|
54
|
+
| `vault_password_history` | 列出条目的历史密码(1Password/Bitwarden 风格,最新在前,上限 10 条;不含当前密码) |
|
|
55
|
+
| `kind: card` | 银行卡/信用卡条目:`cardNumber`/`cardExpiry`(MM/YY)/`cardCvv`/`cardHolder`;搜索摘要只暴露有效期和持卡人(绝不显示卡号和 CVV);Bitwarden JSON 导出映射为 card 条目(type 3,自动识别卡品牌) |
|
|
56
|
+
| `vault_password_rollback` | 将条目密码回滚到某条历史记录(当前密码先归档,可逆) |
|
|
57
|
+
| `vault_recovery_code` / `vault_verify_recovery` / `vault_recovery_status` | 一次性保险库恢复码(1Password/Bitwarden 风格):32 位代码仅显示一次,只保存其 SHA-256 哈希;可验证代码持有;查询是否已设置 |
|
|
54
58
|
| `vault_rekey` | 原地升级 scrypt KDF 参数并重加密 |
|
|
55
59
|
| `vault_backup` | 带时间戳的加密备份,支持保留策略:超过 `maxBackups`(默认 10)的旧备份自动清理 |
|
|
56
60
|
| `vault_import_csv` | 从 CSV 批量导入凭据(自定义列变为 fields;`overwrite: true` 合并字段到已有条目,不再产生重复) |
|
|
61
|
+
| `vault_bulk_delete` | 按 query/kind/tag 或显式 ids 批量软删除条目;需 `confirm: true`(默认仅试运行);回收站可恢复 |
|
|
57
62
|
| `vault_apply_tags` | 按查询批量增/删/替换条目标签(支持 dry-run,不含密钥) |
|
|
58
63
|
| `vault_totp_uri` | 为存储的或裸 TOTP 密钥生成 otpauth:// 配置 URI |
|
|
59
64
|
| `vault_switch` / `vault_list` | 按名称切换当前保险库 / 列出可用保险库 |
|
|
60
65
|
| `vault_rotation` | 报告已过期 / 待轮换 / 即将过期的凭据;`soonWindowDays`(1-90,默认 7)调整即将窗口(不含密钥) |
|
|
61
66
|
| `vault_health` | 保险库健康扫描:弱密码/复用凭据、未启用 2FA、不安全的 http:// 站点,以及整体安全评分(0–100) |
|
|
67
|
+
| `vault_watchtower` | 每个条目的风险分析(借鉴 1Password Watchtower / Bitwarden):标记弱密码、键盘序列、嵌入年份、常见密码、跨条目复用、http 站点、缺 2FA、过期——带 0–100 评分与 good/warn/poor 判定(不含机密);条目行显示 ⚠ 徽标 |
|
|
62
68
|
| `vault_breach_check` | Watchtower 风格泄露扫描:对接 Have I Been Pwned(k-anonymity,仅发送 SHA-1 前缀),附离线常见密码兜底 |
|
|
63
69
|
| `vault_integrity` | 校验磁盘上的保险库文件可正确解密并与内存中的 store 一致 |
|
|
64
70
|
| `vault_merge` | 合并一个条目到另一个;`keepSource: true` 保留源条目 |
|
|
71
|
+
| `vault_attach` / `vault_attachments` / `vault_attachment` / `vault_detach` | 给条目附加文件(私钥、证书、配置、恢复码)——base64 存于加密条目内随库加密;列出/读取/移除 |
|
|
65
72
|
| `vault_quick_add` | 快速录入(标题 + 一个密钥),支持 tags/notes |
|
|
66
73
|
| `vault_expiry` | 设置/清除过期(`expiresAt: 0` 移除) |
|
|
67
74
|
| `vault_stats` | 概览计数,含 `trashCount`(不含密钥) |
|
|
@@ -72,12 +79,14 @@ dsh-vault 是一个面向 DeepSeek Harness 的安全加密插件:把你在使
|
|
|
72
79
|
| `vault_backup` / `vault_backup_now` | 时间戳加密备份,文件名 `<库名>-backups-YYYY-MM-DD_HH-MM-SS-<hex>.json`(库名+日期一目了然);自动保留最近 N 份 |
|
|
73
80
|
| `vault_restore_backup` | 从备份还原:`mode: "merge"`(默认)把备份条目复制进当前库,出现在条目列表;`mode: "replace"` 整体覆盖(先写安全快照) |
|
|
74
81
|
| `vault_vault_rename` / `vault_vault_delete` | 重命名命名库(文件移动,当前会话跟随)或永久删除(default 库受保护) |
|
|
82
|
+
| `vault_match_url` | 按 URL 查找匹配的登录条目(Bitwarden/1Password 风格:精确主机、子域、父域、路径前缀;www./端口归一化),带 0–100 评分——绝不返回密码 |
|
|
75
83
|
| `vault_fill` | 按 host/URL/用户名/标题匹配条目并返回其凭据 |
|
|
76
84
|
| `vault_env` | 把标记 env 的条目(tags 含 `env`)渲染为 `KEY=VALUE` 行 |
|
|
77
85
|
| `vault_export_bitwarden` / `vault_import_bitwarden` | Bitwarden/Vaultwarden JSON 互通(完整字段映射,支持覆盖) |
|
|
78
86
|
| `vault_import_bitwarden_encrypted` | 解密 Bitwarden 口令保护 JSON 导出(PBKDF2/Argon2id + HKDF → AES-256-CBC + HMAC)并导入,需提供导出口令 |
|
|
79
87
|
| `vault_import_manager_csv` | 密码管理器 CSV 自动识别表头:Bitwarden(login_uri/login_username/…)、1Password 8、Dashlane、NordPass、Keeper、LastPass(fav/grouping/extra);支持 dryRun 预览 |
|
|
80
88
|
| `vault_import_kdbx` | KeePass KDBX:3.1 与 4.x、AES-KDF 或 Argon2(RFC 9106)、AES-256-CBC 或 ChaCha20 载荷、支持 keyfile |
|
|
89
|
+
| `vault_export_1password` | 导出为 1Password 1PUX 归档(ZIP + export.data),可导入 1Password 或用 vault_import_1password 再导入;条目类别映射 login/信用卡/API 凭据/服务器 |
|
|
81
90
|
| `vault_import_1password` / `vault_import_1pif` | 1Password 1PUX(ZIP)与旧版 1PIF 文本导出 |
|
|
82
91
|
| `vault_import_enpass` | Enpass JSON 导出(文件夹→标签、类型化字段、TOTP) |
|
|
83
92
|
| `vault_import_keepass_xml` | KeePass 2.x XML 导出(明文或 ****** 掩码值) |
|
|
@@ -93,7 +102,7 @@ dsh-vault 是一个面向 DeepSeek Harness 的安全加密插件:把你在使
|
|
|
93
102
|
| `vault_session_close` | 关闭已打开的浏览器登录会话(已收集的 cookie 仍保留在保险库中) |
|
|
94
103
|
| `vault_session_prune` | 移除已保存会话中的过期 cookie(无过期的会话 cookie 保留);`preview: true` 只报告不修改 |
|
|
95
104
|
| `vault_copy` | 复制条目(含密钥)到另一个命名保险库 |
|
|
96
|
-
| `vault_templates` | 内建 + 用户自定义模板(save/list/remove,KeePassXC 风格) |
|
|
105
|
+
| `vault_templates` | 内建 + 用户自定义模板(save/list/remove,KeePassXC 风格);内建模板新增 Wi-Fi、服务器、数据库、身份、银行账户、银行卡(借鉴 1Password) | 内建 + 用户自定义模板(save/list/remove,KeePassXC 风格) |
|
|
97
106
|
|
|
98
107
|
**典型开发场景**:存一条 SSH 凭据(`kind: ssh` + host/port/username/password 或 privateKey),开发时让模型 `vault_search` 找主机、`vault_get` 取连接信息;存 API 网关的 `api-key`/`oauth` 条目管理 access/refresh token 轮换。
|
|
99
108
|
|
package/README.md
CHANGED
|
@@ -53,17 +53,24 @@ Each record has a `title`, an optional `kind`, and any combination of fields:
|
|
|
53
53
|
| `vault_totp` | Generate the current 6-digit code for a stored otpSecret (or a bare Base32 / otpauth URI) |
|
|
54
54
|
| `vault_generate_password` | Generate a strong random password (length/classes/grouping) **or a memorable passphrase** (`passphrase: true`, EFF-style word list, `words`/`separator`/`wordDigits`) |
|
|
55
55
|
| `vault_strength` | Zero-dependency password strength estimate (score 0–100, weak/fair/strong/very strong) |
|
|
56
|
+
| `vault_password_history` | List an entry's previous passwords (1Password/Bitwarden-style, newest first, capped at 10; current password excluded) |
|
|
57
|
+
| `kind: card` | Bank/credit-card entries: `cardNumber`/`cardExpiry` (MM/YY)/`cardCvv`/`cardHolder`; search summaries expose expiry + holder only (never the number or CVV); Bitwarden JSON export maps to a `card` item (type 3, brand inferred) |
|
|
58
|
+
| `vault_password_rollback` | Restore an entry password to a stored history entry (current password is archived first, so it is reversible) |
|
|
59
|
+
| `vault_recovery_code` / `vault_verify_recovery` / `vault_recovery_status` | One-time vault recovery code (1Password/Bitwarden-style): 32-char code shown once, only its SHA-256 hash is stored; verify possession of the code; check whether one is set |
|
|
56
60
|
| `vault_rekey` | Upgrade the vault to fresh scrypt KDF parameters in place |
|
|
57
61
|
| `vault_backup` | Timestamped encrypted backup with retention; optional `note` |
|
|
58
62
|
| `vault_import_csv` | Bulk-import credentials from a CSV file (custom columns become fields; `overwrite: true` merges fields into existing entries instead of duplicating) |
|
|
63
|
+
| `vault_bulk_delete` | Soft-delete entries matching a query/kind/tag or explicit ids; `confirm: true` required (dry-run by default); trashed entries are restorable |
|
|
59
64
|
| `vault_apply_tags` | Bulk add/remove/replace tags on every entry matching a query (dry-run supported, no secrets) |
|
|
60
65
|
| `vault_totp_uri` | Build an otpauth:// provisioning URI for a stored or bare TOTP secret |
|
|
61
66
|
| `vault_switch` / `vault_list` | Switch the active vault by name / list available vaults |
|
|
62
67
|
| `vault_rotation` | Report expired / due-for-rotation / expiring-soon credentials; `soonWindowDays` (1-90, default 7) tunes the soon horizon (no secrets) |
|
|
63
68
|
| `vault_health` | Vault health scan: weak/reused passwords, missing 2FA, insecure http:// sites, and an overall security score (0–100) |
|
|
69
|
+
| `vault_watchtower` | Watchtower-style per-entry risk analysis (1Password/Bitwarden-inspired): flags short/weak passwords, keyboard sequences, embedded years, common passwords, reuse, http:// sites, missing 2FA, expiry — with a 0–100 score and good/warn/poor verdict (no secrets); entry rows show ⚠ badges |
|
|
64
70
|
| `vault_breach_check` | Watchtower-style breach scan against Have I Been Pwned (k-anonymity: only the SHA-1 prefix leaves the machine), with an offline common-password fallback |
|
|
65
71
|
| `vault_integrity` | Verify the on-disk vault file decrypts correctly and matches the in-memory store |
|
|
66
72
|
| `vault_merge` | Merge one entry into another; `keepSource: true` keeps the source after merging |
|
|
73
|
+
| `vault_attach` / `vault_attachments` / `vault_attachment` / `vault_detach` | Attach files to entries (private keys, certs, configs, recovery codes) — stored base64 inside the encrypted entry, encrypted at rest; list names/sizes, read content, remove |
|
|
67
74
|
| `vault_quick_add` | Fast capture (title + one secret) with optional tags/notes |
|
|
68
75
|
| `vault_expiry` | Set/clear expiry (`expiresAt: 0` removes it) |
|
|
69
76
|
| `vault_stats` | Overview counts incl. `trashCount` (no secrets) |
|
|
@@ -74,12 +81,14 @@ Each record has a `title`, an optional `kind`, and any combination of fields:
|
|
|
74
81
|
| `vault_backup` / `vault_backup_now` | Timestamped encrypted backup named `<vault>-backups-YYYY-MM-DD_HH-MM-SS-<hex>.json` (owning vault + date visible); retention pruning keeps the newest N |
|
|
75
82
|
| `vault_restore_backup` | Restore from a backup: `mode: "merge"` (default) copies the backup entries INTO the current vault so they appear in the entries list; `mode: "replace"` overwrites the whole vault with a safety snapshot first |
|
|
76
83
|
| `vault_vault_rename` / `vault_vault_delete` | Rename a named vault (file moves, active session follows) or permanently delete one (default vault protected) |
|
|
84
|
+
| `vault_match_url` | Find login entries matching a URL (Bitwarden/1Password-style: exact host, subdomain, parent domain, path-prefix; www./port normalization) with a 0–100 score — never returns the password |
|
|
77
85
|
| `vault_fill` | Find the entry matching a host/URL/username/title and return its credentials |
|
|
78
86
|
| `vault_env` | Render env-flagged entries (tags contain `env`) as `KEY=VALUE` lines |
|
|
79
87
|
| `vault_export_bitwarden` / `vault_import_bitwarden` | Bitwarden/Vaultwarden JSON interop (full field mapping, overwrite support) |
|
|
80
88
|
| `vault_import_bitwarden_encrypted` | Decrypt a Bitwarden password-protected JSON export (PBKDF2/Argon2id + HKDF → AES-256-CBC + HMAC) and import it; pass the export passphrase |
|
|
81
89
|
| `vault_import_manager_csv` | Password-manager CSV auto-detected by header: Bitwarden (`login_uri`/`login_username`/…), 1Password 8, Dashlane, NordPass, Keeper, LastPass (`fav`/`grouping`/`extra`); dryRun preview |
|
|
82
90
|
| `vault_import_kdbx` | KeePass KDBX: 3.1 and 4.x, AES-KDF or Argon2 (RFC 9106), AES-256-CBC or ChaCha20 payload, keyfile support |
|
|
91
|
+
| `vault_export_1password` | Export entries as a 1Password 1PUX archive (ZIP + export.data) for import into 1Password or re-import here; item categories map to login / credit card / API credential / server |
|
|
83
92
|
| `vault_import_1password` / `vault_import_1pif` | 1Password 1PUX (ZIP) and legacy 1PIF text exports |
|
|
84
93
|
| `vault_import_enpass` | Enpass JSON export (folders → tags, typed fields, TOTP) |
|
|
85
94
|
| `vault_import_keepass_xml` | KeePass 2.x XML export (plaintext or `********` masked values) |
|
|
@@ -95,7 +104,7 @@ Each record has a `title`, an optional `kind`, and any combination of fields:
|
|
|
95
104
|
| `vault_session_close` | Close an open browser login session (collected cookies stay in the vault) |
|
|
96
105
|
| `vault_session_prune` | Remove expired cookies from a saved session (session cookies are kept); `preview: true` reports without writing |
|
|
97
106
|
| `vault_copy` | Copy an entry (secrets included) into another named vault |
|
|
98
|
-
| `vault_templates` | Built-in + user-defined templates (save/list/remove), KeePassXC-style |
|
|
107
|
+
| `vault_templates` | Built-in + user-defined templates (save/list/remove), KeePassXC-style; built-ins now include Wi-Fi, Server, Database, Identity, Bank account, Card (1Password-inspired) | Built-in + user-defined templates (save/list/remove), KeePassXC-style |
|
|
99
108
|
|
|
100
109
|
**Typical workflows**: store an SSH credential (`kind: ssh` + host/port/username/password or privateKey) and have the model `vault_search` for the host then `vault_get` the connection details; keep `api-key`/`oauth` entries for API-gateway access/refresh token rotation.
|
|
101
110
|
|