dsh-vault 0.8.7 → 0.8.9
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 +7 -2
- package/README.md +7 -2
- package/lib/client.js +174 -47
- package/lib/client.js.map +1 -1
- package/lib/index.js +98 -23
- package/lib/password.js +43 -0
- package/lib/store.js +18 -10
- package/package.json +1 -1
package/README-zh.md
CHANGED
|
@@ -49,15 +49,20 @@ dsh-vault 是一个面向 DeepSeek Harness 的安全加密插件:把你在使
|
|
|
49
49
|
| `vault_restore` / `vault_purge` | 从回收站恢复 / 从磁盘永久移除 |
|
|
50
50
|
| `vault_lock` / `vault_unlock` | 显式锁定保险库(清空内存密钥)/ 重新解锁 |
|
|
51
51
|
| `vault_totp` | 为存储的 otpSecret(或直接传入的 Base32/otpauth URI)生成当前 6 位动态验证码 |
|
|
52
|
-
| `vault_generate_password` |
|
|
52
|
+
| `vault_generate_password` | 生成强随机密码(长度/字符集/分组可选)**或易记口令短语**(`passphrase: true`,EFF 词表,`words`/`separator`/`wordDigits`) |
|
|
53
53
|
| `vault_strength` | 零依赖密码强度评估(0–100 分,weak/fair/strong/very strong) |
|
|
54
54
|
| `vault_rekey` | 原地升级 scrypt KDF 参数并重加密 |
|
|
55
|
+
| `vault_backup` | 带时间戳的加密备份,支持保留策略:超过 `maxBackups`(默认 10)的旧备份自动清理 |
|
|
55
56
|
| `vault_import_csv` | 从 CSV 批量导入凭据(自定义列变为 fields;`overwrite: true` 合并字段到已有条目,不再产生重复) |
|
|
56
57
|
| `vault_apply_tags` | 按查询批量增/删/替换条目标签(支持 dry-run,不含密钥) |
|
|
57
58
|
| `vault_totp_uri` | 为存储的或裸 TOTP 密钥生成 otpauth:// 配置 URI |
|
|
58
59
|
| `vault_switch` / `vault_list` | 按名称切换当前保险库 / 列出可用保险库 |
|
|
59
|
-
| `vault_rotation` | 报告已过期 / 待轮换 /
|
|
60
|
+
| `vault_rotation` | 报告已过期 / 待轮换 / 即将过期的凭据;`soonWindowDays`(1-90,默认 7)调整即将窗口(不含密钥) |
|
|
60
61
|
| `vault_health` | 扫描弱密码与跨条目复用凭据(不含密钥) |
|
|
62
|
+
| `vault_merge` | 合并一个条目到另一个;`keepSource: true` 保留源条目 |
|
|
63
|
+
| `vault_quick_add` | 快速录入(标题 + 一个密钥),支持 tags/notes |
|
|
64
|
+
| `vault_expiry` | 设置/清除过期(`expiresAt: 0` 移除) |
|
|
65
|
+
| `vault_stats` | 概览计数,含 `trashCount`(不含密钥) |
|
|
61
66
|
| `vault_export` / `vault_import` | 整库加密备份/迁移(独立导出密码) |
|
|
62
67
|
| `vault_fill` | 按 host/URL/用户名/标题匹配条目并返回其凭据 |
|
|
63
68
|
| `vault_env` | 把标记 env 的条目(tags 含 `env`)渲染为 `KEY=VALUE` 行 |
|
package/README.md
CHANGED
|
@@ -51,15 +51,20 @@ Each record has a `title`, an optional `kind`, and any combination of fields:
|
|
|
51
51
|
| `vault_restore` / `vault_purge` | Bring a trashed entry back / permanently remove it from disk |
|
|
52
52
|
| `vault_lock` / `vault_unlock` | Explicitly lock the vault (wipe the in-memory key) / re-unlock it |
|
|
53
53
|
| `vault_totp` | Generate the current 6-digit code for a stored otpSecret (or a bare Base32 / otpauth URI) |
|
|
54
|
-
| `vault_generate_password` | Generate a strong random password (length/
|
|
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
56
|
| `vault_rekey` | Upgrade the vault to fresh scrypt KDF parameters in place |
|
|
57
|
+
| `vault_backup` | Timestamped encrypted backup with retention: prunes old copies beyond `maxBackups` (default 10) |
|
|
57
58
|
| `vault_import_csv` | Bulk-import credentials from a CSV file (custom columns become fields; `overwrite: true` merges fields into existing entries instead of duplicating) |
|
|
58
59
|
| `vault_apply_tags` | Bulk add/remove/replace tags on every entry matching a query (dry-run supported, no secrets) |
|
|
59
60
|
| `vault_totp_uri` | Build an otpauth:// provisioning URI for a stored or bare TOTP secret |
|
|
60
61
|
| `vault_switch` / `vault_list` | Switch the active vault by name / list available vaults |
|
|
61
|
-
| `vault_rotation` | Report expired / due-for-rotation / expiring-soon credentials (no secrets) |
|
|
62
|
+
| `vault_rotation` | Report expired / due-for-rotation / expiring-soon credentials; `soonWindowDays` (1-90, default 7) tunes the soon horizon (no secrets) |
|
|
62
63
|
| `vault_health` | Scan for weak passwords and credentials reused across entries (no secrets) |
|
|
64
|
+
| `vault_merge` | Merge one entry into another; `keepSource: true` keeps the source after merging |
|
|
65
|
+
| `vault_quick_add` | Fast capture (title + one secret) with optional tags/notes |
|
|
66
|
+
| `vault_expiry` | Set/clear expiry (`expiresAt: 0` removes it) |
|
|
67
|
+
| `vault_stats` | Overview counts incl. `trashCount` (no secrets) |
|
|
63
68
|
| `vault_export` / `vault_import` | Portable encrypted backup/migration of the whole vault (separate export password) |
|
|
64
69
|
| `vault_fill` | Find the entry matching a host/URL/username/title and return its credentials |
|
|
65
70
|
| `vault_env` | Render env-flagged entries (tags contain `env`) as `KEY=VALUE` lines |
|
package/lib/client.js
CHANGED
|
@@ -7,7 +7,7 @@ window.__ModuleLoader__.load({
|
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
//#region \0dsh-css:/Users/zhipeng/Desktop/work/dsh test/dsh-vault/src/client/VaultSection.module.css.mjs
|
|
10
|
-
const css = ".t_j5va_section{flex-direction:column;gap:12px;padding:16px 0;display:flex}.t_j5va_intro{opacity:.75;margin:0;font-size:13px}.t_j5va_toolbar{align-items:center;gap:8px;display:flex}.t_j5va_searchBox{flex:1;display:flex}.t_j5va_searchBox input{border:1px solid var(--color-border,#444);color:inherit;background:0 0;border-radius:6px;flex:1;padding:6px 10px;font-size:13px}.t_j5va_addButton,.t_j5va_saveButton{background:var(--color-accent,#4f8cff);color:#fff;cursor:pointer;border:1px solid #0000;border-radius:6px;padding:6px 12px;font-size:13px}.t_j5va_addButton:disabled,.t_j5va_saveButton:disabled,.t_j5va_rowActions button:disabled{opacity:.5;cursor:not-allowed}.t_j5va_list{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.t_j5va_row{border:1px solid var(--color-border,#333);border-radius:8px;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;display:flex}.t_j5va_rowMain{flex-direction:column;gap:2px;min-width:0;display:flex}.t_j5va_title{font-size:14px;font-weight:600}.t_j5va_identity{opacity:.7;text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.t_j5va_totp{font-family:var(--font-mono,monospace);color:var(--color-accent,#4f8cff);font-size:13px}.t_j5va_rowActions{flex-shrink:0;align-items:center;gap:6px;display:flex}.t_j5va_rowActions button{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:4px 8px;font-size:12px}.t_j5va_deleteButton{color:#e5484d}.t_j5va_copied{color:#30a46c;font-size:12px}.t_j5va_empty,.t_j5va_status,.t_j5va_error{opacity:.8;font-size:13px}.t_j5va_modeReadonly,.t_j5va_modeAsk,.t_j5va_modeAuto{border-radius:999px;width:fit-content;margin:0;padding:4px 10px;font-size:12px;display:inline-block}.t_j5va_modeReadonly{color:#e5484d;border:1px solid #e5484d80}.t_j5va_modeAsk{color:#f5a524;border:1px solid #f5a52480}.t_j5va_modeAuto{color:#30a46c;border:1px solid #30a46c80}.t_j5va_policyBar{flex-direction:column;align-items:flex-start;gap:6px;display:flex}.t_j5va_policyField{align-items:center;gap:8px;font-size:13px;display:flex}.t_j5va_policyField select{border:1px solid var(--color-border,#444);color:inherit;background:0 0;border-radius:6px;padding:4px 8px;font-size:13px}.t_j5va_emptyBox{flex-direction:column;gap:4px;display:flex}.t_j5va_emptyHint{opacity:.65;margin:0;font-size:12px}.t_j5va_error{color:#e5484d}.t_j5va_editor{border:1px solid var(--color-border,#444);border-radius:8px;padding:12px}.t_j5va_editorBody{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px 12px;display:grid}.t_j5va_field{flex-direction:column;gap:4px;font-size:12px;display:flex}.t_j5va_field input,.t_j5va_field select{border:1px solid var(--color-border,#444);color:inherit;background:0 0;border-radius:6px;padding:5px 8px;font-size:13px}.t_j5va_editorActions{justify-content:flex-end;gap:8px;margin-top:12px;display:flex}.t_j5va_editorActions button{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:6px 12px;font-size:13px}.t_j5va_reportBox{border:1px solid #f5a52466;border-radius:8px;flex-direction:column;gap:2px;padding:8px 10px;font-size:12px;display:flex}.t_j5va_reportTitle{margin:0;font-weight:600}.t_j5va_reportLine{opacity:.8;margin:0}.t_j5va_trashButton{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;align-self:flex-start;padding:4px 8px;font-size:12px}.t_j5va_secretField{gap:4px;display:flex}.t_j5va_secretField input{flex:1;min-width:0}.t_j5va_revealButton{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:0 8px;font-size:12px}.t_j5va_kindFilter{border:1px solid var(--color-border,#444);color:inherit;background:0 0;border-radius:6px;padding:6px 8px;font-size:13px}.t_j5va_highBadge{color:#e5484d;vertical-align:middle;background:#e5484d26;border-radius:4px;margin-left:6px;padding:1px 6px;font-size:10px;font-weight:600}.t_j5va_pinStar{color:#f5a524;margin-right:4px}.t_j5va_clearButton{color:inherit;cursor:pointer;opacity:.6;background:0 0;border:none;padding:0 8px;font-size:16px}.t_j5va_field textarea{border:1px solid var(--color-border,#444);color:inherit;resize:vertical;background:0 0;border-radius:6px;padding:5px 8px;font-family:inherit;font-size:13px}.t_j5va_row{transition:background .12s}.t_j5va_row:hover{background:var(--color-hover,#80808014)}.t_j5va_healthBar{flex-wrap:wrap;gap:6px;margin:0 0 10px;display:flex}.t_j5va_badge{border:1px solid var(--dsh-color-border,#ddd);background:var(--dsh-color-surface-2,#f7f7f8);color:var(--dsh-color-text-2,#555);border-radius:999px;padding:4px 10px;font-size:12px;line-height:1}.t_j5va_badgeOk{color:#2e9e5b;border-color:#2e9e5b}.t_j5va_badgeWarn{color:#b57f1a;border-color:#c98a1b}.t_j5va_rowDue{border-left:3px solid #c98a1b}.t_j5va_rowExpired{border-left:3px solid #cf3d3d}.t_j5va_dueBadge{border-radius:999px;margin-left:6px;padding:3px 8px;font-size:11px;font-weight:600;line-height:1}.t_j5va_badgeDanger{color:#c03a3a;border-color:#cf3d3d}.t_j5va_footer{opacity:.6;margin:0;font-size:12px}.t_j5va_kindIcon{margin-right:4px;font-size:12px}.t_j5va_dangerButton{color:#e5484d;cursor:pointer;background:0 0;border:1px solid #e5484d80;border-radius:6px;align-self:flex-start;padding:4px 8px;font-size:12px}.t_j5va_rowMain{cursor:pointer}.t_j5va_detailBox{background:var(--color-hover,#8080800f);border-radius:6px;flex-wrap:wrap;grid-column:1/-1;gap:4px 12px;padding:6px 8px;font-size:12px;display:flex}.t_j5va_detailItem{opacity:.85}.t_j5va_sortButton{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:6px 10px;font-size:13px}";
|
|
10
|
+
const css = ".t_j5va_section{flex-direction:column;gap:12px;padding:16px 0;display:flex}.t_j5va_intro{opacity:.75;margin:0;font-size:13px}.t_j5va_toolbar{align-items:center;gap:8px;display:flex}.t_j5va_searchBox{flex:1;display:flex}.t_j5va_searchBox input{border:1px solid var(--color-border,#444);color:inherit;background:0 0;border-radius:6px;flex:1;padding:6px 10px;font-size:13px}.t_j5va_addButton,.t_j5va_saveButton{background:var(--color-accent,#4f8cff);color:#fff;cursor:pointer;border:1px solid #0000;border-radius:6px;padding:6px 12px;font-size:13px}.t_j5va_addButton:disabled,.t_j5va_saveButton:disabled,.t_j5va_rowActions button:disabled{opacity:.5;cursor:not-allowed}.t_j5va_list{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.t_j5va_row{border:1px solid var(--color-border,#333);border-radius:8px;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;display:flex}.t_j5va_rowMain{flex-direction:column;gap:2px;min-width:0;display:flex}.t_j5va_title{font-size:14px;font-weight:600}.t_j5va_identity{opacity:.7;text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.t_j5va_totp{font-family:var(--font-mono,monospace);color:var(--color-accent,#4f8cff);font-size:13px}.t_j5va_rowActions{flex-shrink:0;align-items:center;gap:6px;display:flex}.t_j5va_rowActions button{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:4px 8px;font-size:12px}.t_j5va_deleteButton{color:#e5484d}.t_j5va_copied{color:#30a46c;font-size:12px}.t_j5va_empty,.t_j5va_status,.t_j5va_error{opacity:.8;font-size:13px}.t_j5va_modeReadonly,.t_j5va_modeAsk,.t_j5va_modeAuto{border-radius:999px;width:fit-content;margin:0;padding:4px 10px;font-size:12px;display:inline-block}.t_j5va_modeReadonly{color:#e5484d;border:1px solid #e5484d80}.t_j5va_modeAsk{color:#f5a524;border:1px solid #f5a52480}.t_j5va_modeAuto{color:#30a46c;border:1px solid #30a46c80}.t_j5va_policyBar{flex-direction:column;align-items:flex-start;gap:6px;display:flex}.t_j5va_policyField{align-items:center;gap:8px;font-size:13px;display:flex}.t_j5va_policyField select{border:1px solid var(--color-border,#444);color:inherit;background:0 0;border-radius:6px;padding:4px 8px;font-size:13px}.t_j5va_emptyBox{flex-direction:column;gap:4px;display:flex}.t_j5va_emptyHint{opacity:.65;margin:0;font-size:12px}.t_j5va_error{color:#e5484d}.t_j5va_editor{border:1px solid var(--color-border,#444);border-radius:8px;padding:12px}.t_j5va_editorBody{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px 12px;display:grid}.t_j5va_checkField{align-items:center;gap:8px;font-size:13px;display:inline-flex}.t_j5va_field{flex-direction:column;gap:4px;font-size:12px;display:flex}.t_j5va_field input,.t_j5va_field select{border:1px solid var(--color-border,#444);color:inherit;background:0 0;border-radius:6px;padding:5px 8px;font-size:13px}.t_j5va_editorActions{justify-content:flex-end;gap:8px;margin-top:12px;display:flex}.t_j5va_editorActions button{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:6px 12px;font-size:13px}.t_j5va_reportBox{border:1px solid #f5a52466;border-radius:8px;flex-direction:column;gap:2px;padding:8px 10px;font-size:12px;display:flex}.t_j5va_reportTitle{margin:0;font-weight:600}.t_j5va_reportLine{opacity:.8;margin:0}.t_j5va_reportSub{color:var(--dsh-color-text-2,#666);margin:2px 0 0 10px;font-size:12px}.t_j5va_trashButton{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;align-self:flex-start;padding:4px 8px;font-size:12px}.t_j5va_secretField{gap:4px;display:flex}.t_j5va_secretField input{flex:1;min-width:0}.t_j5va_revealButton{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:0 8px;font-size:12px}.t_j5va_kindFilter{border:1px solid var(--color-border,#444);color:inherit;background:0 0;border-radius:6px;padding:6px 8px;font-size:13px}.t_j5va_highBadge{color:#e5484d;vertical-align:middle;background:#e5484d26;border-radius:4px;margin-left:6px;padding:1px 6px;font-size:10px;font-weight:600}.t_j5va_pinStar{color:#f5a524;margin-right:4px}.t_j5va_clearButton{color:inherit;cursor:pointer;opacity:.6;background:0 0;border:none;padding:0 8px;font-size:16px}.t_j5va_field textarea{border:1px solid var(--color-border,#444);color:inherit;resize:vertical;background:0 0;border-radius:6px;padding:5px 8px;font-family:inherit;font-size:13px}.t_j5va_row{transition:background .12s}.t_j5va_row:hover{background:var(--color-hover,#80808014)}.t_j5va_healthBar{flex-wrap:wrap;gap:6px;margin:0 0 10px;display:flex}.t_j5va_badge{border:1px solid var(--dsh-color-border,#ddd);background:var(--dsh-color-surface-2,#f7f7f8);color:var(--dsh-color-text-2,#555);border-radius:999px;padding:4px 10px;font-size:12px;line-height:1}.t_j5va_backupButton{border:1px solid var(--dsh-color-border,#ccc);background:var(--dsh-color-surface-2,#f7f7f8);cursor:pointer;border-radius:999px;padding:4px 10px;font-size:12px;line-height:1}.t_j5va_badgeOk{color:#2e9e5b;border-color:#2e9e5b}.t_j5va_badgeWarn{color:#b57f1a;border-color:#c98a1b}.t_j5va_rowDue{border-left:3px solid #c98a1b}.t_j5va_rowExpired{border-left:3px solid #cf3d3d}.t_j5va_dueBadge{border-radius:999px;margin-left:6px;padding:3px 8px;font-size:11px;font-weight:600;line-height:1}.t_j5va_badgeDanger{color:#c03a3a;border-color:#cf3d3d}.t_j5va_footer{opacity:.6;margin:0;font-size:12px}.t_j5va_kindIcon{margin-right:4px;font-size:12px}.t_j5va_dangerButton{color:#e5484d;cursor:pointer;background:0 0;border:1px solid #e5484d80;border-radius:6px;align-self:flex-start;padding:4px 8px;font-size:12px}.t_j5va_rowMain{cursor:pointer}.t_j5va_detailBox{background:var(--color-hover,#8080800f);border-radius:6px;flex-wrap:wrap;grid-column:1/-1;gap:4px 12px;padding:6px 8px;font-size:12px;display:flex}.t_j5va_detailItem{opacity:.85}.t_j5va_sortButton{border:1px solid var(--color-border,#444);color:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:6px 10px;font-size:13px}";
|
|
11
11
|
const tagId = "dsh-vault/VaultSection.module.css";
|
|
12
12
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
13
13
|
const tag = document.createElement("style");
|
|
@@ -17,59 +17,62 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
document.head.appendChild(tag);
|
|
18
18
|
}
|
|
19
19
|
var VaultSection_module_css_default = {
|
|
20
|
-
"highBadge": "t_j5va_highBadge",
|
|
21
20
|
"badge": "t_j5va_badge",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
21
|
+
"rowDue": "t_j5va_rowDue",
|
|
22
|
+
"healthBar": "t_j5va_healthBar",
|
|
23
|
+
"rowActions": "t_j5va_rowActions",
|
|
24
|
+
"row": "t_j5va_row",
|
|
25
|
+
"totp": "t_j5va_totp",
|
|
26
|
+
"rowMain": "t_j5va_rowMain",
|
|
27
|
+
"error": "t_j5va_error",
|
|
28
|
+
"policyBar": "t_j5va_policyBar",
|
|
29
|
+
"saveButton": "t_j5va_saveButton",
|
|
30
|
+
"checkField": "t_j5va_checkField",
|
|
31
|
+
"reportLine": "t_j5va_reportLine",
|
|
25
32
|
"editor": "t_j5va_editor",
|
|
26
33
|
"editorBody": "t_j5va_editorBody",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"modeAuto": "t_j5va_modeAuto",
|
|
30
|
-
"row": "t_j5va_row",
|
|
31
|
-
"searchBox": "t_j5va_searchBox",
|
|
34
|
+
"kindFilter": "t_j5va_kindFilter",
|
|
35
|
+
"detailBox": "t_j5va_detailBox",
|
|
32
36
|
"title": "t_j5va_title",
|
|
33
|
-
"
|
|
37
|
+
"trashButton": "t_j5va_trashButton",
|
|
38
|
+
"empty": "t_j5va_empty",
|
|
39
|
+
"pinStar": "t_j5va_pinStar",
|
|
40
|
+
"clearButton": "t_j5va_clearButton",
|
|
34
41
|
"modeAsk": "t_j5va_modeAsk",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"list": "t_j5va_list",
|
|
38
|
-
"rowExpired": "t_j5va_rowExpired",
|
|
42
|
+
"deleteButton": "t_j5va_deleteButton",
|
|
43
|
+
"toolbar": "t_j5va_toolbar",
|
|
39
44
|
"emptyBox": "t_j5va_emptyBox",
|
|
40
|
-
"
|
|
45
|
+
"addButton": "t_j5va_addButton",
|
|
46
|
+
"copied": "t_j5va_copied",
|
|
47
|
+
"modeReadonly": "t_j5va_modeReadonly",
|
|
48
|
+
"reportTitle": "t_j5va_reportTitle",
|
|
41
49
|
"revealButton": "t_j5va_revealButton",
|
|
42
|
-
"deleteButton": "t_j5va_deleteButton",
|
|
43
|
-
"empty": "t_j5va_empty",
|
|
44
|
-
"reportBox": "t_j5va_reportBox",
|
|
45
50
|
"badgeDanger": "t_j5va_badgeDanger",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
51
|
+
"footer": "t_j5va_footer",
|
|
52
|
+
"modeAuto": "t_j5va_modeAuto",
|
|
53
|
+
"reportSub": "t_j5va_reportSub",
|
|
54
|
+
"dangerButton": "t_j5va_dangerButton",
|
|
48
55
|
"detailItem": "t_j5va_detailItem",
|
|
56
|
+
"identity": "t_j5va_identity",
|
|
57
|
+
"sortButton": "t_j5va_sortButton",
|
|
49
58
|
"field": "t_j5va_field",
|
|
50
|
-
"
|
|
59
|
+
"reportBox": "t_j5va_reportBox",
|
|
60
|
+
"dueBadge": "t_j5va_dueBadge",
|
|
61
|
+
"searchBox": "t_j5va_searchBox",
|
|
51
62
|
"emptyHint": "t_j5va_emptyHint",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"copied": "t_j5va_copied",
|
|
57
|
-
"policyBar": "t_j5va_policyBar",
|
|
58
|
-
"kindFilter": "t_j5va_kindFilter",
|
|
63
|
+
"editorActions": "t_j5va_editorActions",
|
|
64
|
+
"list": "t_j5va_list",
|
|
65
|
+
"section": "t_j5va_section",
|
|
66
|
+
"policyField": "t_j5va_policyField",
|
|
59
67
|
"secretField": "t_j5va_secretField",
|
|
60
|
-
"
|
|
61
|
-
"rowActions": "t_j5va_rowActions",
|
|
62
|
-
"clearButton": "t_j5va_clearButton",
|
|
63
|
-
"healthBar": "t_j5va_healthBar",
|
|
64
|
-
"dueBadge": "t_j5va_dueBadge",
|
|
65
|
-
"toolbar": "t_j5va_toolbar",
|
|
66
|
-
"dangerButton": "t_j5va_dangerButton",
|
|
68
|
+
"highBadge": "t_j5va_highBadge",
|
|
67
69
|
"intro": "t_j5va_intro",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
70
|
+
"status": "t_j5va_status",
|
|
71
|
+
"backupButton": "t_j5va_backupButton",
|
|
72
|
+
"badgeOk": "t_j5va_badgeOk",
|
|
73
|
+
"badgeWarn": "t_j5va_badgeWarn",
|
|
74
|
+
"rowExpired": "t_j5va_rowExpired",
|
|
75
|
+
"kindIcon": "t_j5va_kindIcon"
|
|
73
76
|
};
|
|
74
77
|
//#endregion
|
|
75
78
|
//#region src/client/VaultSection.tsx
|
|
@@ -139,6 +142,22 @@ window.__ModuleLoader__.load({
|
|
|
139
142
|
key: "notes",
|
|
140
143
|
label: "fieldNotes"
|
|
141
144
|
},
|
|
145
|
+
{
|
|
146
|
+
key: "expiresAt",
|
|
147
|
+
label: "fieldExpiresAt"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
key: "rotationDays",
|
|
151
|
+
label: "fieldRotationDays"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: "sensitivity",
|
|
155
|
+
label: "fieldSensitivity"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "favorite",
|
|
159
|
+
label: "fieldFavorite"
|
|
160
|
+
},
|
|
142
161
|
{
|
|
143
162
|
key: "icon",
|
|
144
163
|
label: "fieldIcon"
|
|
@@ -172,7 +191,7 @@ window.__ModuleLoader__.load({
|
|
|
172
191
|
}
|
|
173
192
|
/** Render the Vault settings section. */
|
|
174
193
|
function VaultSection(props) {
|
|
175
|
-
const { t, config, setAccessMode, setAutoCapture, list, search, get, add, update, remove, trash, rotation, health, history, stats, backupStatus, recent, restore, undeleteAll, totp } = props;
|
|
194
|
+
const { t, config, setAccessMode, setAutoCapture, list, search, get, add, update, remove, trash, rotation, health, history, stats, backupStatus, backup, recent, restore, undeleteAll, totp } = props;
|
|
176
195
|
const searchId = (0, react.useId)();
|
|
177
196
|
const [query, setQuery] = (0, react.useState)("");
|
|
178
197
|
const [state, setState] = (0, react.useState)({ status: "loading" });
|
|
@@ -199,6 +218,24 @@ window.__ModuleLoader__.load({
|
|
|
199
218
|
const [backupInfo, setBackupInfo] = (0, react.useState)(null);
|
|
200
219
|
const [recentEntries, setRecentEntries] = (0, react.useState)([]);
|
|
201
220
|
const readonly = policy?.accessMode === "readonly";
|
|
221
|
+
/** Run an encrypted backup now and refresh the backup-age badge. */
|
|
222
|
+
async function backupNow() {
|
|
223
|
+
setBusy(true);
|
|
224
|
+
setMessage(null);
|
|
225
|
+
try {
|
|
226
|
+
const result = await backup(10);
|
|
227
|
+
setBackupInfo({
|
|
228
|
+
daysSinceBackup: 0,
|
|
229
|
+
backups: result.kept
|
|
230
|
+
});
|
|
231
|
+
setMessage(`${t("backupDone")} (${result.kept} kept, ${result.pruned} pruned)`);
|
|
232
|
+
refresh();
|
|
233
|
+
} catch {
|
|
234
|
+
setMessage(t("error"));
|
|
235
|
+
} finally {
|
|
236
|
+
setBusy(false);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
202
239
|
(0, react.useEffect)(() => {
|
|
203
240
|
let current = true;
|
|
204
241
|
config().then((value) => {
|
|
@@ -316,7 +353,11 @@ window.__ModuleLoader__.load({
|
|
|
316
353
|
url: entry.url ?? "",
|
|
317
354
|
notes: entry.notes ?? "",
|
|
318
355
|
icon: entry.icon ?? "",
|
|
319
|
-
color: entry.color ?? ""
|
|
356
|
+
color: entry.color ?? "",
|
|
357
|
+
expiresAt: entry.expiresAt,
|
|
358
|
+
rotationDays: entry.rotationDays,
|
|
359
|
+
sensitivity: entry.sensitivity,
|
|
360
|
+
favorite: entry.favorite ?? false
|
|
320
361
|
});
|
|
321
362
|
setTagsDraft((entry.tags ?? []).join(", "));
|
|
322
363
|
setFieldsDraft(entry.fields !== void 0 ? Object.entries(entry.fields).map(([k, v]) => `${k}=${String(v)}`).join("\n") : "");
|
|
@@ -332,7 +373,7 @@ window.__ModuleLoader__.load({
|
|
|
332
373
|
}
|
|
333
374
|
/** Save the current form (create or update). */
|
|
334
375
|
async function save() {
|
|
335
|
-
if (!form.title.trim()) {
|
|
376
|
+
if (!(form.title ?? "").trim()) {
|
|
336
377
|
setMessage(t("error"));
|
|
337
378
|
return;
|
|
338
379
|
}
|
|
@@ -349,7 +390,7 @@ window.__ModuleLoader__.load({
|
|
|
349
390
|
fields[trimmed.slice(0, eq).trim()] = trimmed.slice(eq + 1).trim();
|
|
350
391
|
}
|
|
351
392
|
const patch = {
|
|
352
|
-
title: form.title.trim(),
|
|
393
|
+
title: (form.title ?? "").trim(),
|
|
353
394
|
...form.kind !== void 0 ? { kind: form.kind } : {},
|
|
354
395
|
...form.username !== void 0 ? { username: form.username } : {},
|
|
355
396
|
...form.email !== void 0 ? { email: form.email } : {},
|
|
@@ -367,6 +408,10 @@ window.__ModuleLoader__.load({
|
|
|
367
408
|
...form.notes !== void 0 ? { notes: form.notes } : {},
|
|
368
409
|
...form.icon !== void 0 ? { icon: form.icon } : {},
|
|
369
410
|
...form.color !== void 0 ? { color: form.color } : {},
|
|
411
|
+
...form.expiresAt !== void 0 ? { expiresAt: form.expiresAt } : {},
|
|
412
|
+
...form.rotationDays !== void 0 ? { rotationDays: form.rotationDays } : {},
|
|
413
|
+
...form.sensitivity !== void 0 ? { sensitivity: form.sensitivity } : {},
|
|
414
|
+
...form.favorite !== void 0 ? { favorite: form.favorite } : {},
|
|
370
415
|
tags,
|
|
371
416
|
fields
|
|
372
417
|
};
|
|
@@ -652,14 +697,21 @@ window.__ModuleLoader__.load({
|
|
|
652
697
|
className: VaultSection_module_css_default.reportTitle,
|
|
653
698
|
children: t("reportTitle")
|
|
654
699
|
}),
|
|
655
|
-
report.rotation.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
700
|
+
report.rotation.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
656
701
|
className: VaultSection_module_css_default.reportLine,
|
|
657
702
|
children: [
|
|
658
703
|
t("reportRotation"),
|
|
659
704
|
": ",
|
|
660
705
|
report.rotation.length
|
|
661
706
|
]
|
|
662
|
-
}),
|
|
707
|
+
}), report.rotation.slice(0, 8).map((item, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
708
|
+
className: VaultSection_module_css_default.reportSub,
|
|
709
|
+
children: [
|
|
710
|
+
"· ",
|
|
711
|
+
String(item.title ?? "?"),
|
|
712
|
+
item.due === "expired" ? ` (${t("dueExpired")})` : item.due === "soon" ? ` (${t("dueExpiring")} ${item.daysLeft ?? 0}d)` : ` (${t("dueNow")})`
|
|
713
|
+
]
|
|
714
|
+
}, i))] }),
|
|
663
715
|
report.weak.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
664
716
|
className: VaultSection_module_css_default.reportLine,
|
|
665
717
|
children: [
|
|
@@ -930,6 +982,13 @@ window.__ModuleLoader__.load({
|
|
|
930
982
|
backupInfo.daysSinceBackup,
|
|
931
983
|
"d"
|
|
932
984
|
]
|
|
985
|
+
}),
|
|
986
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
987
|
+
type: "button",
|
|
988
|
+
className: VaultSection_module_css_default.backupButton,
|
|
989
|
+
onClick: () => void backupNow(),
|
|
990
|
+
disabled: busy,
|
|
991
|
+
children: t("backupNow")
|
|
933
992
|
})
|
|
934
993
|
]
|
|
935
994
|
}),
|
|
@@ -988,6 +1047,53 @@ window.__ModuleLoader__.load({
|
|
|
988
1047
|
})),
|
|
989
1048
|
children: revealed[field.key] ? t("hide") : t("show")
|
|
990
1049
|
})]
|
|
1050
|
+
}) : field.key === "expiresAt" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1051
|
+
type: "datetime-local",
|
|
1052
|
+
value: form.expiresAt !== void 0 ? new Date(form.expiresAt).toISOString().slice(0, 16) : "",
|
|
1053
|
+
onChange: (event) => {
|
|
1054
|
+
const raw = event.target.value;
|
|
1055
|
+
const epoch = raw.length > 0 ? Date.parse(raw) : NaN;
|
|
1056
|
+
setForm((previous) => ({
|
|
1057
|
+
...previous,
|
|
1058
|
+
expiresAt: Number.isNaN(epoch) ? void 0 : epoch
|
|
1059
|
+
}));
|
|
1060
|
+
}
|
|
1061
|
+
}) : field.key === "rotationDays" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1062
|
+
type: "number",
|
|
1063
|
+
min: 0,
|
|
1064
|
+
max: 3650,
|
|
1065
|
+
placeholder: t("rotationClearHint"),
|
|
1066
|
+
value: form.rotationDays ?? "",
|
|
1067
|
+
onChange: (event) => {
|
|
1068
|
+
const raw = event.target.value;
|
|
1069
|
+
setForm((previous) => ({
|
|
1070
|
+
...previous,
|
|
1071
|
+
rotationDays: raw.length > 0 ? Number(raw) : void 0
|
|
1072
|
+
}));
|
|
1073
|
+
}
|
|
1074
|
+
}) : field.key === "sensitivity" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1075
|
+
value: form.sensitivity ?? "normal",
|
|
1076
|
+
onChange: (event) => setForm((previous) => ({
|
|
1077
|
+
...previous,
|
|
1078
|
+
sensitivity: event.target.value === "high" ? "high" : "normal"
|
|
1079
|
+
})),
|
|
1080
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1081
|
+
value: "normal",
|
|
1082
|
+
children: t("sensitivityNormal")
|
|
1083
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1084
|
+
value: "high",
|
|
1085
|
+
children: t("sensitivityHigh")
|
|
1086
|
+
})]
|
|
1087
|
+
}) : field.key === "favorite" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1088
|
+
className: VaultSection_module_css_default.checkField,
|
|
1089
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1090
|
+
type: "checkbox",
|
|
1091
|
+
checked: form.favorite ?? false,
|
|
1092
|
+
onChange: (event) => setForm((previous) => ({
|
|
1093
|
+
...previous,
|
|
1094
|
+
favorite: event.target.checked
|
|
1095
|
+
}))
|
|
1096
|
+
}), t("favoriteHint")]
|
|
991
1097
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
992
1098
|
type: "text",
|
|
993
1099
|
value: form[field.key] ?? "",
|
|
@@ -1067,6 +1173,8 @@ window.__ModuleLoader__.load({
|
|
|
1067
1173
|
reportReused: "credentials reused across entries",
|
|
1068
1174
|
healthOk: "vault healthy",
|
|
1069
1175
|
healthBackup: "backup",
|
|
1176
|
+
backupNow: "Backup now",
|
|
1177
|
+
backupDone: "Backup created",
|
|
1070
1178
|
healthStrength: "strength",
|
|
1071
1179
|
dueExpired: "EXPIRED",
|
|
1072
1180
|
dueExpiring: "expires in",
|
|
@@ -1116,6 +1224,14 @@ window.__ModuleLoader__.load({
|
|
|
1116
1224
|
fieldNotes: "Notes",
|
|
1117
1225
|
fieldTags: "Tags",
|
|
1118
1226
|
fieldIcon: "Icon (emoji)",
|
|
1227
|
+
fieldExpiresAt: "Expires at",
|
|
1228
|
+
fieldRotationDays: "Rotation (days, 0 = never)",
|
|
1229
|
+
fieldSensitivity: "Sensitivity",
|
|
1230
|
+
fieldFavorite: "Pinned",
|
|
1231
|
+
sensitivityNormal: "normal",
|
|
1232
|
+
sensitivityHigh: "high",
|
|
1233
|
+
favoriteHint: "Show at top",
|
|
1234
|
+
rotationClearHint: "0 clears rotation",
|
|
1119
1235
|
fieldColor: "Color",
|
|
1120
1236
|
fieldCustom: "Custom fields (key=value per line)",
|
|
1121
1237
|
error: "Something went wrong.",
|
|
@@ -1156,6 +1272,8 @@ window.__ModuleLoader__.load({
|
|
|
1156
1272
|
reportReused: "跨条目复用的凭据",
|
|
1157
1273
|
healthOk: "凭据库健康",
|
|
1158
1274
|
healthBackup: "备份",
|
|
1275
|
+
backupNow: "立即备份",
|
|
1276
|
+
backupDone: "备份已创建",
|
|
1159
1277
|
healthStrength: "强度",
|
|
1160
1278
|
dueExpired: "已过期",
|
|
1161
1279
|
dueExpiring: "将于",
|
|
@@ -1205,6 +1323,14 @@ window.__ModuleLoader__.load({
|
|
|
1205
1323
|
fieldNotes: "备注",
|
|
1206
1324
|
fieldTags: "标签",
|
|
1207
1325
|
fieldIcon: "图标(emoji)",
|
|
1326
|
+
fieldExpiresAt: "过期时间",
|
|
1327
|
+
fieldRotationDays: "轮换周期(天,0=永不)",
|
|
1328
|
+
fieldSensitivity: "敏感级别",
|
|
1329
|
+
fieldFavorite: "置顶",
|
|
1330
|
+
sensitivityNormal: "普通",
|
|
1331
|
+
sensitivityHigh: "高敏",
|
|
1332
|
+
favoriteHint: "列表置顶显示",
|
|
1333
|
+
rotationClearHint: "0 清除轮换",
|
|
1208
1334
|
fieldColor: "颜色",
|
|
1209
1335
|
fieldCustom: "自定义字段(每行 key=value)",
|
|
1210
1336
|
error: "操作失败。",
|
|
@@ -1266,6 +1392,7 @@ window.__ModuleLoader__.load({
|
|
|
1266
1392
|
stats: () => invoke("stats"),
|
|
1267
1393
|
recent: () => invoke("recent").then((r) => r.entries),
|
|
1268
1394
|
backupStatus: () => invoke("backupStatus"),
|
|
1395
|
+
backup: (maxBackups) => invoke("backup", { maxBackups: maxBackups ?? 10 }),
|
|
1269
1396
|
health: () => invoke("health"),
|
|
1270
1397
|
restore: (id) => invoke("restore", { id }),
|
|
1271
1398
|
undeleteAll: () => invoke("undeleteAll"),
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["css"],"sources":["../src/client/VaultSection.tsx","../src/client/locales.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Vault settings section: list, search, add, edit, delete, and copy encrypted\n * credentials. All mutations go through the host VaultGateway remote; secrets\n * are shown only inside the edit form or a copy action, never in the list.\n */\n\nimport { useEffect, useId, useMemo, useState, type ReactNode } from 'react'\nimport type { PropsLocale, PropsRuntime, InjectFace, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { VaultLocaleKey } from './locales.ts'\nimport css from './VaultSection.module.css'\n\n/** Wire shapes shared with the host gateway (mirror of src/index.ts types). */\nexport interface VaultSummaryWire {\n id: string\n title: string\n sensitivity?: string\n kind?: string\n username?: string\n email?: string\n phone?: string\n host?: string\n port?: string\n url?: string\n tags?: string[]\n}\n\nexport interface VaultFullWire {\n id: string\n title: string\n kind?: string\n username?: string\n email?: string\n phone?: string\n password?: string\n host?: string\n port?: string\n privateKey?: string\n apiKey?: string\n secret?: string\n accessToken?: string\n refreshToken?: string\n expiresAt?: number\n otpSecret?: string\n url?: string\n notes?: string\n tags?: string[]\n icon?: string\n color?: string\n fields?: Record<string, unknown>\n}\n\n/** Patch shape accepted by vault.add / vault.update. */\nexport type VaultPatch = Partial<Omit<VaultFullWire, 'id'>>\n\n/** Registration-side business face supplied by the plugin entry. */\nexport interface VaultSectionInjected {\n t: TranslateNS<'settings.vault'>\n config: () => Promise<{ accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean }>\n setAccessMode: (mode: 'readonly' | 'ask' | 'auto') => Promise<{ accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean }>\n setAutoCapture: (enabled: boolean) => Promise<{ accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean }>\n list: () => Promise<VaultSummaryWire[]>\n search: (query: string, limit?: number) => Promise<VaultSummaryWire[]>\n get: (id: string) => Promise<{ found: boolean; entry?: VaultFullWire }>\n add: (patch: VaultPatch & { title: string }) => Promise<VaultSummaryWire>\n update: (id: string, patch: VaultPatch) => Promise<{ found: boolean; entry?: VaultSummaryWire }>\n remove: (id: string) => Promise<{ deleted: boolean }>\n trash: () => Promise<VaultSummaryWire[]>\n rotation: () => Promise<unknown[]>\n history: () => Promise<unknown[]>\n stats: () => Promise<Record<string, unknown>>\n recent: () => Promise<unknown[]>\n backupStatus: () => Promise<{ daysSinceBackup: number; backups: number }>\n health: () => Promise<{ weak: unknown[]; reused: unknown[]; strength: { weak: number; fair: number; strong: number } }>\n restore: (id: string) => Promise<{ restored: boolean }>\n undeleteAll: () => Promise<{ restored: number }>\n totp: (id: string) => Promise<{ code: string; label?: string; secondsRemaining: number }>\n}\n\n/** Type-level alias so consumers can reference the wire shapes without values. */\nexport type VaultSectionTypes = {\n entries: VaultSummaryWire[]\n fullEntry: VaultFullWire\n summaryEntry: VaultSummaryWire\n config: { accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean }\n accessModes: Array<'readonly' | 'ask' | 'auto'>\n}\n\n/** Full component props assembled by the Settings slot renderer. */\nexport type VaultSectionProps =\n PropsRuntime<'settings.section'>\n & PropsLocale<'settings.vault'>\n & InjectFace<VaultSectionInjected>\n\n/** The editable form fields we render (subset of the full wire). */\ntype FormFields = Pick<\n VaultFullWire, 'title' | 'kind' | 'username' | 'email' | 'phone' | 'password' | 'host' | 'port'\n | 'privateKey' | 'apiKey' | 'secret' | 'accessToken' | 'refreshToken' | 'otpSecret' | 'url' | 'notes'\n | 'icon' | 'color'\n>\n\nconst FORM_FIELDS: Array<{ key: keyof FormFields; label: VaultLocaleKey }> = [\n { key: 'title', label: 'fieldTitle' },\n { key: 'kind', label: 'fieldKind' },\n { key: 'username', label: 'fieldUsername' },\n { key: 'email', label: 'fieldEmail' },\n { key: 'phone', label: 'fieldPhone' },\n { key: 'password', label: 'fieldPassword' },\n { key: 'host', label: 'fieldHost' },\n { key: 'port', label: 'fieldPort' },\n { key: 'apiKey', label: 'fieldApiKey' },\n { key: 'secret', label: 'fieldSecret' },\n { key: 'accessToken', label: 'fieldAccessToken' },\n { key: 'refreshToken', label: 'fieldRefreshToken' },\n { key: 'otpSecret', label: 'fieldOtpSecret' },\n { key: 'url', label: 'fieldUrl' },\n { key: 'notes', label: 'fieldNotes' },\n { key: 'icon', label: 'fieldIcon' },\n { key: 'color', label: 'fieldColor' },\n]\n\nconst KIND_KEYS: Record<string, VaultLocaleKey> = {\n login: 'kindLogin',\n ssh: 'kindSsh',\n 'api-key': 'kindApiKey',\n secret: 'kindSecret',\n oauth: 'kindOauth',\n custom: 'kindCustom',\n}\n\ntype ViewState =\n | { readonly status: 'loading' }\n | { readonly status: 'error' }\n | { readonly status: 'ready'; readonly entries: VaultSummaryWire[] }\n\ntype EditorState =\n | { readonly status: 'closed' }\n | { readonly status: 'creating' }\n | { readonly status: 'editing'; readonly entry: VaultFullWire }\n\nfunction emptyForm(): FormFields {\n return { title: '', kind: 'login', username: '', email: '', phone: '', password: '', host: '', port: '', icon: '', color: '' }\n}\n\n/** Render the Vault settings section. */\nexport function VaultSection(props: VaultSectionProps): ReactNode {\n const { t, config, setAccessMode, setAutoCapture, list, search, get, add, update, remove, trash, rotation, health, history, stats, backupStatus, recent, restore, undeleteAll, totp } = props\n const searchId = useId()\n const [query, setQuery] = useState('')\n const [state, setState] = useState<ViewState>({ status: 'loading' })\n const [editor, setEditor] = useState<EditorState>({ status: 'closed' })\n const [form, setForm] = useState<FormFields>(emptyForm())\n const [busy, setBusy] = useState(false)\n const [message, setMessage] = useState<string | null>(null)\n const [copiedId, setCopiedId] = useState<string | null>(null)\n const [codeMap, setCodeMap] = useState<Record<string, string>>({})\n const [tagsDraft, setTagsDraft] = useState('')\n const [fieldsDraft, setFieldsDraft] = useState('')\n const [revealed, setRevealed] = useState<Record<string, boolean>>({})\n const [kindFilter, setKindFilter] = useState('')\n const [tagFilter, setTagFilter] = useState('')\n const [expandedId, setExpandedId] = useState<string | null>(null)\n const [sortBy, setSortBy] = useState<'alpha' | 'recent'>('alpha')\n const [policy, setPolicy] = useState<{ accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean } | null>(null)\n const [showTrash, setShowTrash] = useState(false)\n const [trashEntries, setTrashEntries] = useState<VaultSummaryWire[]>([])\n const [report, setReport] = useState<{ rotation: unknown[]; weak: unknown[]; reused: unknown[]; strength: { weak: number; fair: number; strong: number } | null } | null>(null)\n const [dueMap, setDueMap] = useState<Record<string, { due: string; daysLeft: number }>>({})\n const [recentEvents, setRecentEvents] = useState<Array<Record<string, unknown>>>([])\n const [vaultStats, setVaultStats] = useState<Record<string, unknown> | null>(null)\n const [backupInfo, setBackupInfo] = useState<{ daysSinceBackup: number; backups: number } | null>(null)\n const [recentEntries, setRecentEntries] = useState<Array<Record<string, unknown>>>([])\n\n const readonly = policy?.accessMode === 'readonly'\n\n useEffect(() => {\n let current = true\n void config().then(\n value => { if (current) setPolicy(value) },\n () => { /* policy is informational; ignore failures */ },\n )\n return () => { current = false }\n }, [config])\n\n const refresh = useMemo(() => async () => {\n setState({ status: 'loading' })\n try {\n const entries = query.trim().length === 0\n ? await list()\n : await search(query.trim())\n setState({ status: 'ready', entries })\n } catch {\n setState({ status: 'error' })\n }\n }, [list, search, query])\n\n useEffect(() => {\n let current = true\n const timer = window.setTimeout(() => {\n void refresh().then(\n () => { /* state already set inside refresh */ },\n () => { if (current) setState({ status: 'error' }) },\n )\n }, 250)\n return () => { current = false; window.clearTimeout(timer) }\n // refresh is memoized on query (debounced); list/search are stable.\n }, [refresh])\n\n // Vault health & meta: load once on mount (stats, backup age, rotation,\n // weak/reused scan, recent activity) and refresh on window focus.\n useEffect(() => {\n let current = true\n const load = (): void => {\n void Promise.all([\n stats().catch(() => null),\n backupStatus().catch(() => null),\n rotation().catch(() => []),\n health().catch(() => null),\n recent().catch(() => []),\n ]).then(([st, bk, rot, hl, rc]) => {\n if (!current) return\n if (st !== null) setVaultStats(st as Record<string, unknown>)\n if (bk !== null) setBackupInfo(bk)\n setReport({ rotation: (rot ?? []) as unknown[], weak: ((hl?.weak ?? []) as unknown[]), reused: ((hl?.reused ?? []) as unknown[]), strength: (hl?.strength ?? null) as { weak: number; fair: number; strong: number } | null })\n const due: Record<string, { due: string; daysLeft: number }> = {}\n for (const item of (rot ?? []) as Array<{ id?: string; due?: string; daysLeft?: number }>) {\n if (item.id !== undefined && item.due !== undefined) due[item.id] = { due: item.due, daysLeft: item.daysLeft ?? 0 }\n }\n setDueMap(due)\n setRecentEntries((rc ?? []) as Array<Record<string, unknown>>)\n })\n }\n load()\n const onFocus = (): void => { load() }\n window.addEventListener('focus', onFocus)\n return () => { current = false; window.removeEventListener('focus', onFocus) }\n }, [stats, backupStatus, rotation, health, recent])\n\n /** Open the editor for a new entry. */\n function startCreate(): void {\n setForm(emptyForm())\n setTagsDraft('')\n setFieldsDraft('')\n setMessage(null)\n setEditor({ status: 'creating' })\n }\n\n /** Open the editor for an existing entry (fetches full secrets). */\n async function startEdit(id: string): Promise<void> {\n setBusy(true)\n setMessage(null)\n try {\n const result = await get(id)\n if (!result.found || result.entry === undefined) {\n setMessage(t('error'))\n return\n }\n const entry = result.entry\n setForm({\n title: entry.title ?? '',\n kind: entry.kind ?? 'login',\n username: entry.username ?? '',\n email: entry.email ?? '',\n phone: entry.phone ?? '',\n password: entry.password ?? '',\n host: entry.host ?? '',\n port: entry.port ?? '',\n privateKey: entry.privateKey ?? '',\n apiKey: entry.apiKey ?? '',\n secret: entry.secret ?? '',\n accessToken: entry.accessToken ?? '',\n refreshToken: entry.refreshToken ?? '',\n otpSecret: entry.otpSecret ?? '',\n url: entry.url ?? '',\n notes: entry.notes ?? '',\n icon: entry.icon ?? '',\n color: entry.color ?? '',\n })\n setTagsDraft((entry.tags ?? []).join(', '))\n setFieldsDraft(entry.fields !== undefined ? Object.entries(entry.fields).map(([k, v]) => `${k}=${String(v)}`).join('\\n') : '')\n setEditor({ status: 'editing', entry })\n } catch {\n setMessage(t('error'))\n } finally {\n setBusy(false)\n }\n }\n\n /** Save the current form (create or update). */\n async function save(): Promise<void> {\n if (!form.title.trim()) {\n setMessage(t('error'))\n return\n }\n setBusy(true)\n setMessage(null)\n try {\n const tags = tagsDraft.split(',').map(x => x.trim()).filter(x => x.length > 0)\n const fields: Record<string, string> = {}\n for (const line of fieldsDraft.split('\\n')) {\n const trimmed = line.trim()\n if (trimmed.length === 0) continue\n const eq = trimmed.indexOf('=')\n if (eq <= 0) continue\n fields[trimmed.slice(0, eq).trim()] = trimmed.slice(eq + 1).trim()\n }\n const patch: VaultPatch = {\n title: form.title.trim(),\n ...(form.kind !== undefined ? { kind: form.kind } : {}),\n ...(form.username !== undefined ? { username: form.username } : {}),\n ...(form.email !== undefined ? { email: form.email } : {}),\n ...(form.phone !== undefined ? { phone: form.phone } : {}),\n ...(form.password !== undefined ? { password: form.password } : {}),\n ...(form.host !== undefined ? { host: form.host } : {}),\n ...(form.port !== undefined ? { port: form.port } : {}),\n ...(form.privateKey !== undefined ? { privateKey: form.privateKey } : {}),\n ...(form.apiKey !== undefined ? { apiKey: form.apiKey } : {}),\n ...(form.secret !== undefined ? { secret: form.secret } : {}),\n ...(form.accessToken !== undefined ? { accessToken: form.accessToken } : {}),\n ...(form.refreshToken !== undefined ? { refreshToken: form.refreshToken } : {}),\n ...(form.otpSecret !== undefined ? { otpSecret: form.otpSecret } : {}),\n ...(form.url !== undefined ? { url: form.url } : {}),\n ...(form.notes !== undefined ? { notes: form.notes } : {}),\n ...(form.icon !== undefined ? { icon: form.icon } : {}),\n ...(form.color !== undefined ? { color: form.color } : {}),\n // Always send tags: an empty array clears them, and the host store\n // treats empty string values as \"clear this field\" too.\n tags,\n fields,\n }\n if (editor.status === 'creating') {\n await add(patch as VaultPatch & { title: string })\n } else if (editor.status === 'editing') {\n await update(editor.entry.id, patch)\n }\n setEditor({ status: 'closed' })\n await refresh()\n } catch {\n setMessage(t('error'))\n } finally {\n setBusy(false)\n }\n }\n\n /** Delete an entry after confirmation. */\n async function removeEntry(id: string): Promise<void> {\n if (!window.confirm(t('deleteConfirm'))) return\n setBusy(true)\n try {\n await remove(id)\n await refresh()\n } catch {\n setMessage(t('error'))\n } finally {\n setBusy(false)\n }\n }\n\n /** Copy a field value to the clipboard and flash the row. */\n async function copyValue(id: string, value: string): Promise<void> {\n try {\n await navigator.clipboard.writeText(value)\n } catch {\n // Clipboard may be blocked; fall back to a temporary textarea.\n const textarea = document.createElement('textarea')\n textarea.value = value\n document.body.appendChild(textarea)\n textarea.select()\n document.execCommand('copy')\n textarea.remove()\n }\n setCopiedId(id)\n window.setTimeout(() => setCopiedId(null), 1500)\n }\n\n /** Fetch and display a TOTP code for an entry with an otpSecret. */\n async function showTotp(id: string): Promise<void> {\n setBusy(true)\n try {\n const result = await totp(id)\n setCodeMap(previous => ({ ...previous, [id]: `${result.code} (${result.secondsRemaining}s)` }))\n } catch {\n setCodeMap(previous => ({ ...previous, [id]: t('error') }))\n } finally {\n setBusy(false)\n }\n }\n\n /** Field-set summary line for one entry (non-secret). */\n function kindIcon(kind?: string): string {\n switch (kind ?? 'login') {\n case 'ssh': return '🖥️'\n case 'api-key': return '🔑'\n case 'oauth': return '🔐'\n case 'secret': return '🤫'\n case 'custom': return '🧩'\n default: return '👤'\n }\n }\n\n function identityLine(entry: VaultSummaryWire): string {\n const parts = [\n entry.kind !== undefined ? t(KIND_KEYS[entry.kind] ?? 'kindCustom') : t('kindLogin'),\n entry.username,\n entry.email,\n entry.phone,\n entry.host !== undefined ? `${entry.host}${entry.port !== undefined ? `:${entry.port}` : ''}` : undefined,\n entry.url,\n ].filter((value): value is string => value !== undefined && value.length > 0)\n return parts.join(' · ')\n }\n\n return (\n <section className={css.section} aria-labelledby=\"vault-heading\">\n <h2 id=\"vault-heading\">{t('heading')}</h2>\n <p className={css.intro}>{t('intro')}</p>\n\n <div className={css.toolbar}>\n <label className={css.searchBox}>\n <span className=\"sr-only\">{t('searchPlaceholder')}</span>\n <input\n id={searchId}\n type=\"search\"\n placeholder={t('searchPlaceholder')}\n value={query}\n onChange={event => setQuery(event.target.value)}\n />\n {query.length > 0 && (\n <button type=\"button\" className={css.clearButton} onClick={() => setQuery('')} aria-label={t('clearSearch')}>×</button>\n )}\n </label>\n <select className={css.kindFilter} value={kindFilter} onChange={e => setKindFilter(e.target.value)} aria-label={t('fieldKind')}>\n <option value=\"\">{t('allKinds')}</option>\n {Object.entries(KIND_KEYS).map(([value, key]) => (\n <option key={value} value={value}>{t(key)}</option>\n ))}\n </select>\n <select className={css.kindFilter} value={tagFilter} onChange={e => setTagFilter(e.target.value)} aria-label={t('fieldTags')}>\n <option value=\"\">{t('allTags')}</option>\n {[...new Set(state.status === 'ready' ? state.entries.flatMap(e => e.tags ?? []) : [])].sort().map(tag => (\n <option key={tag} value={tag}>{tag}</option>\n ))}\n </select>\n <button\n type=\"button\"\n className={css.sortButton}\n onClick={() => setSortBy(sortBy === 'alpha' ? 'recent' : 'alpha')}\n >{sortBy === 'alpha' ? t('sortAlpha') : t('sortRecent')}</button>\n <button type=\"button\" className={css.addButton} onClick={startCreate} disabled={busy || readonly}>\n + {t('add')}\n </button>\n </div>\n\n {policy !== null && (\n <div className={css.policyBar}>\n <label className={css.policyField}>\n <span>{t('modeLabel')}</span>\n <select\n value={policy.accessMode}\n disabled={busy}\n onChange={event => {\n const next = event.target.value as 'readonly' | 'ask' | 'auto'\n setBusy(true)\n setMessage(null)\n void setAccessMode(next).then(\n value => { setPolicy(value); setBusy(false) },\n () => { setMessage(t('error')); setBusy(false) },\n )\n }}\n >\n <option value=\"readonly\">{t('modeReadonly')}</option>\n <option value=\"ask\">{t('modeAsk')}</option>\n <option value=\"auto\">{t('modeAuto')}</option>\n </select>\n </label>\n <label className={css.policyField}>\n <span>{t('autoCaptureLabel')}</span>\n <input\n type=\"checkbox\"\n checked={policy.autoCapture}\n disabled={busy}\n onChange={event => {\n const next = event.target.checked\n setBusy(true)\n setMessage(null)\n void setAutoCapture(next).then(\n value => { setPolicy(value); setBusy(false) },\n () => { setMessage(t('error')); setBusy(false) },\n )\n }}\n />\n </label>\n <p className={policy.accessMode === 'readonly' ? css.modeReadonly : policy.accessMode === 'ask' ? css.modeAsk : css.modeAuto}>\n {policy.accessMode === 'readonly'\n ? t('modeReadonlyHint')\n : policy.accessMode === 'ask'\n ? t('modeAskHint')\n : t('modeAutoHint')}\n {policy.autoCapture ? ` · ${t('autoCaptureOn')}` : ` · ${t('autoCaptureOff')}`}\n </p>\n </div>\n )}\n\n {message !== null && <p role=\"alert\" className={css.error}>{message}</p>}\n\n {state.status === 'loading' && <p className={css.status}>{t('loading')}</p>}\n {state.status === 'error' && <p role=\"alert\" className={css.error}>{t('error')}</p>}\n {state.status === 'ready' && state.entries.length === 0 && (\n <div className={css.emptyBox}>\n <p className={css.empty}>{t('empty')}</p>\n <p className={css.emptyHint}>{readonly ? t('emptyHintReadonly') : t('emptyHint')}</p>\n {!readonly && (\n <button type=\"button\" className={css.addButton} onClick={startCreate}>{t('quickAdd')}</button>\n )}\n </div>\n )}\n\n {recentEntries.length > 0 && (\n <div className={css.reportBox}>\n <p className={css.reportTitle}>{t('recentlyAdded')}</p>\n {recentEntries.map((e, i) => (\n <p key={i} className={css.reportLine}>{String(e.title ?? '')}</p>\n ))}\n </div>\n )}\n\n {recentEvents.length > 0 && (\n <div className={css.reportBox}>\n <p className={css.reportTitle}>{t('recentActivity')}</p>\n {recentEvents.map((ev, i) => (\n <p key={i} className={css.reportLine}>\n {String(ev.action ?? '')} · {String(ev.title ?? ev.id ?? '')}\n </p>\n ))}\n </div>\n )}\n\n {report !== null && (report.rotation.length > 0 || report.weak.length > 0 || report.reused.length > 0) && (\n <div className={css.reportBox}>\n <p className={css.reportTitle}>{t('reportTitle')}</p>\n {report.rotation.length > 0 && (\n <p className={css.reportLine}>{t('reportRotation')}: {report.rotation.length}</p>\n )}\n {report.weak.length > 0 && (\n <p className={css.reportLine}>{t('reportWeak')}: {report.weak.length}</p>\n )}\n {report.reused.length > 0 && (\n <p className={css.reportLine}>{t('reportReused')}: {report.reused.length}</p>\n )}\n </div>\n )}\n\n {state.status === 'ready' && (state.entries.length > 0 || trashEntries.length > 0) && (\n <button\n type=\"button\"\n className={css.trashButton}\n onClick={() => {\n if (!showTrash) void trash().then(setTrashEntries)\n setShowTrash(!showTrash)\n }}\n >{showTrash ? t('hideTrash') : t('showTrash')}{trashEntries.length > 0 ? ` (${trashEntries.length})` : ''}</button>\n )}\n\n {showTrash && (\n <ul className={css.list}>\n {trashEntries.map(entry => (\n <li key={entry.id} className={css.row}>\n <div className={css.rowMain}>\n <span className={css.title}>{entry.title}</span>\n <span className={css.identity}>{t('trashed')}</span>\n </div>\n <div className={css.rowActions}>\n <button\n type=\"button\"\n onClick={() => { void restore(entry.id).then(() => { void trash().then(setTrashEntries); void refresh() }) }}\n disabled={busy || readonly}\n >{t('restore')}</button>\n </div>\n </li>\n ))}\n {trashEntries.length === 0 && <p className={css.empty}>{t('trashEmpty')}</p>}\n </ul>\n )}\n {showTrash && trashEntries.length > 0 && (\n <>\n <button\n type=\"button\"\n className={css.trashButton}\n onClick={() => {\n setBusy(true)\n void undeleteAll().then(() => {\n void trash().then(setTrashEntries)\n void refresh()\n setBusy(false)\n }, () => setBusy(false))\n }}\n disabled={busy || readonly}\n >{t('restoreAll')}</button>\n <button\n type=\"button\"\n className={css.dangerButton}\n onClick={() => {\n if (!window.confirm(t('clearTrashConfirm'))) return\n setBusy(true)\n void Promise.all(trashEntries.map(e => remove(e.id))).then(() => {\n void trash().then(setTrashEntries)\n void refresh()\n setBusy(false)\n }, () => setBusy(false))\n }}\n disabled={busy || readonly}\n >{t('clearTrash')}</button>\n </>\n )}\n\n {state.status === 'ready' && state.entries.length > 0 && (\n <ul className={css.list}>\n {state.entries.filter(entry => (kindFilter === '' || entry.kind === kindFilter) && (tagFilter === '' || (entry.tags ?? []).includes(tagFilter))).sort((a, b) => sortBy === 'alpha' ? a.title.localeCompare(b.title) : 0).map(entry => {\n const code = codeMap[entry.id]\n return (\n <li key={entry.id} className={`${css.row}${dueMap[entry.id] !== undefined ? ` ${dueMap[entry.id]!.due === 'expired' ? css.rowExpired : css.rowDue}` : ''}`}>\n <div className={css.rowMain} onClick={() => setExpandedId(expandedId === entry.id ? null : entry.id)}>\n <span className={css.title}>\n <span className={css.kindIcon}>{kindIcon(entry.kind)}</span>\n {(entry as VaultSummaryWire & { favorite?: boolean }).favorite && (\n <span className={css.pinStar} title={t('pinned')}>★</span>\n )}\n {entry.title}\n {(entry as VaultSummaryWire & { sensitivity?: string }).sensitivity === 'high' && (\n <span className={css.highBadge}>{t('highSensitivity')}</span>\n )}\n {dueMap[entry.id] !== undefined && (\n <span className={`${css.dueBadge} ${dueMap[entry.id]!.due === 'expired' ? css.badgeDanger : css.badgeWarn}`}>\n {dueMap[entry.id]!.due === 'expired' ? t('dueExpired') : dueMap[entry.id]!.due === 'soon' ? `${t('dueExpiring')} ${dueMap[entry.id]!.daysLeft}d` : t('dueNow')}\n </span>\n )}\n </span>\n <span className={css.identity}>{identityLine(entry)}</span>\n {code !== undefined && <span className={css.totp}>{code}</span>}\n </div>\n {expandedId === entry.id && (\n <div className={css.detailBox}>\n {Object.entries(entry).filter(([k]) => !['id', 'title'].includes(k) && entry[k as keyof VaultSummaryWire] !== undefined).map(([k, v]) => (\n <span key={k} className={css.detailItem}>\n <strong>{k}</strong>: {Array.isArray(v) ? v.join(', ') : String(v)}\n </span>\n ))}\n </div>\n )}\n <div className={css.rowActions}>\n {copiedId === entry.id && <span className={css.copied}>{t('copied')}</span>}\n <button\n type=\"button\"\n onClick={() => void copyValue(entry.id, entry.username ?? entry.title)}\n disabled={busy}\n >{t('copy')}</button>\n <button\n type=\"button\"\n onClick={() => {\n setBusy(true)\n void get(entry.id).then(r => {\n if (r.found && r.entry?.password) void copyValue(entry.id, r.entry.password)\n setBusy(false)\n }, () => setBusy(false))\n }}\n disabled={busy || readonly}\n >{t('copyPassword')}</button>\n <button type=\"button\" onClick={() => void showTotp(entry.id)} disabled={busy}>{t('totp')}</button>\n {code !== undefined && (\n <button type=\"button\" onClick={() => void copyValue(entry.id, code.split(' ')[0]!)} disabled={busy}>{t('copyCode')}</button>\n )}\n <button type=\"button\" onClick={() => void startEdit(entry.id)} disabled={busy || readonly}>{t('edit')}</button>\n <button\n type=\"button\"\n className={css.deleteButton}\n onClick={() => void removeEntry(entry.id)}\n disabled={busy || readonly}\n >{t('delete')}</button>\n </div>\n </li>\n )\n })}\n </ul>\n )}\n\n {state.status === 'ready' && (\n <div className={css.healthBar}>\n {vaultStats !== null && typeof vaultStats.total === 'number' && (\n <span className={css.badge}>{t('entryCount')}: {String(vaultStats.total)}</span>\n )}\n {vaultStats !== null && typeof vaultStats.withTotp === 'number' && (\n <span className={css.badge}>TOTP: {String(vaultStats.withTotp)}</span>\n )}\n {vaultStats !== null && typeof vaultStats.highSensitivity === 'number' && (\n <span className={css.badge}>{t('highSensitivity')}: {String(vaultStats.highSensitivity)}</span>\n )}\n {report !== null && report.strength !== null && (\n <span className={`${css.badge} ${report.strength.weak > 0 ? css.badgeDanger : css.badgeOk}`}>\n {t('healthStrength')}: {report.strength.weak}W/{report.strength.fair}F/{report.strength.strong}S\n </span>\n )}\n {report !== null && report.rotation.length > 0 && (\n <span className={`${css.badge} ${css.badgeWarn}`}>{t('reportRotation')}: {report.rotation.length}</span>\n )}\n {report !== null && report.weak.length > 0 && (\n <span className={`${css.badge} ${css.badgeDanger}`}>{t('reportWeak')}: {report.weak.length}</span>\n )}\n {report !== null && report.reused.length > 0 && (\n <span className={`${css.badge} ${css.badgeDanger}`}>{t('reportReused')}: {report.reused.length}</span>\n )}\n {report !== null && report.rotation.length === 0 && report.weak.length === 0 && report.reused.length === 0 && (\n <span className={`${css.badge} ${css.badgeOk}`}>{t('healthOk')}</span>\n )}\n {backupInfo !== null && backupInfo.daysSinceBackup >= 0 && (\n <span className={`${css.badge} ${backupInfo.daysSinceBackup > 14 ? css.badgeDanger : backupInfo.daysSinceBackup > 7 ? css.badgeWarn : ''}`}>\n {t('healthBackup')}: {backupInfo.daysSinceBackup}d\n </span>\n )}\n </div>\n )}\n {state.status === 'ready' && (\n <p className={css.footer}>\n {t('entryCount')}: {state.entries.length}\n {vaultStats !== null && typeof vaultStats.withTotp === 'number' && ` · TOTP: ${String(vaultStats.withTotp)}`}\n {vaultStats !== null && typeof vaultStats.highSensitivity === 'number' && ` · ${t('highSensitivity')}: ${String(vaultStats.highSensitivity)}`}\n {backupInfo !== null && backupInfo.daysSinceBackup >= 0 && ` · backup: ${backupInfo.daysSinceBackup}d ago`}\n {vaultStats !== null && typeof vaultStats.byTag === 'object' && vaultStats.byTag !== null\n && Object.keys(vaultStats.byTag as Record<string, unknown>).length > 0\n && ` · tags: ${Object.entries(vaultStats.byTag as Record<string, unknown>).map(([k, v]) => `${k}(${String(v)})`).join(' ')}`}\n </p>\n )}\n\n {editor.status !== 'closed' && (\n <div className={css.editor} role=\"dialog\" aria-label={editor.status === 'creating' ? t('add') : t('edit')}>\n <div className={css.editorBody}>\n {FORM_FIELDS.map(field => (\n <label key={field.key} className={css.field}>\n <span>{t(field.label)}</span>\n {field.key === 'kind' ? (\n <select\n value={form.kind ?? 'login'}\n onChange={event => setForm(previous => ({ ...previous, kind: event.target.value }))}\n >\n {Object.entries(KIND_KEYS).map(([value, key]) => (\n <option key={value} value={value}>{t(key)}</option>\n ))}\n </select>\n ) : field.key === 'title' ? (\n <input\n value={form.title ?? ''}\n onChange={event => setForm(previous => ({ ...previous, title: event.target.value }))}\n />\n ) : field.key === 'password' || field.key === 'otpSecret' || field.key === 'apiKey'\n || field.key === 'secret' || field.key === 'accessToken' || field.key === 'refreshToken'\n || field.key === 'privateKey' ? (\n <span className={css.secretField}>\n <input\n type={revealed[field.key] ? 'text' : 'password'}\n value={(form[field.key] as string | undefined) ?? ''}\n onChange={event => setForm(previous => ({ ...previous, [field.key]: event.target.value }))}\n />\n <button\n type=\"button\"\n className={css.revealButton}\n onClick={() => setRevealed(previous => ({ ...previous, [field.key]: !previous[field.key] }))}\n >{revealed[field.key] ? t('hide') : t('show')}</button>\n </span>\n ) : (\n <input\n type=\"text\"\n value={(form[field.key] as string | undefined) ?? ''}\n onChange={event => setForm(previous => ({ ...previous, [field.key]: event.target.value }))}\n />\n )}\n </label>\n ))}\n <label className={css.field}>\n <span>{t('fieldTags')}</span>\n <input\n value={tagsDraft}\n onChange={event => setTagsDraft(event.target.value)}\n placeholder=\"dev, prod\"\n />\n </label>\n <label className={css.field}>\n <span>{t('fieldCustom')}</span>\n <textarea\n value={fieldsDraft}\n onChange={event => setFieldsDraft(event.target.value)}\n rows={3}\n placeholder=\"region=us-east-1 team=infra\"\n />\n </label>\n </div>\n <div className={css.editorActions}>\n <button type=\"button\" onClick={() => setEditor({ status: 'closed' })} disabled={busy}>{t('cancel')}</button>\n <button type=\"button\" className={css.saveButton} onClick={() => void save()} disabled={busy}>{t('save')}</button>\n </div>\n </div>\n )}\n </section>\n )\n}\n","/** Copy dictionaries for the Vault settings section. */\n\n/** English strings (the key-set source of truth for this pair). */\nexport const en = {\n nav: 'Vault',\n heading: 'Vault',\n intro: 'Encrypted credentials stored on this machine.',\n searchPlaceholder: 'Search title, username, email, host…',\n loading: 'Loading…',\n empty: 'No credentials yet. Add one to get started.',\n emptyHint: 'Tip: you can ask the assistant to save an API key or token you share in chat — with auto-capture on it offers to store it for you. Bulk importing? Ask for vault_import_csv with a CSV file path.',\n emptyHintReadonly: 'The vault is in readonly mode — credentials can be read but not added here. Switch accessMode to \"readwrite\" to enable writes.',\n modeLabel: 'Access mode',\n autoCaptureLabel: 'Auto-capture credentials from chat',\n modeReadonly: 'Read-only',\n modeAsk: 'Ask before writing',\n modeAuto: 'Automatic read-write',\n modeReadonlyHint: 'Read-only — mutations disabled',\n modeAskHint: 'Prompt before writing — every add/update/delete asks you',\n modeAutoHint: 'Automatic read-write — no per-call prompt',\n autoCaptureOn: 'auto-capture on',\n autoCaptureOff: 'auto-capture off',\n clearSearch: 'Clear search',\n entryCount: 'Entries',\n reportTitle: 'Health & rotation',\n recentActivity: 'Recent activity',\n recentlyAdded: 'Recently added',\n reportRotation: 'expired / due for rotation',\n reportWeak: 'weak passwords',\n reportReused: 'credentials reused across entries',\n healthOk: 'vault healthy',\n healthBackup: 'backup',\n healthStrength: 'strength',\n dueExpired: 'EXPIRED',\n dueExpiring: 'expires in',\n dueNow: 'rotation due',\n showTrash: 'Trash',\n hideTrash: 'Hide trash',\n trashed: 'in trash',\n trashEmpty: 'Trash is empty',\n restore: 'Restore',\n clearTrash: 'Empty trash',\n restoreAll: 'Restore all',\n clearTrashConfirm: 'Permanently delete ALL trashed entries? This cannot be undone.',\n show: 'Show',\n hide: 'Hide',\n allKinds: 'All kinds',\n allTags: 'All tags',\n sortAlpha: 'Sort: A–Z',\n sortRecent: 'Sort: recent',\n highSensitivity: 'HIGH',\n pinned: 'Pinned',\n add: 'Add credential',\n quickAdd: 'Quick add',\n cancel: 'Cancel',\n save: 'Save',\n edit: 'Edit',\n delete: 'Delete',\n deleteConfirm: 'Delete this entry? This cannot be undone.',\n copy: 'Copy',\n copyPassword: 'Copy password',\n copyCode: 'Copy code',\n copied: 'Copied',\n totp: 'Code',\n fieldTitle: 'Title',\n fieldKind: 'Kind',\n fieldUsername: 'Username',\n fieldEmail: 'Email',\n fieldPhone: 'Phone',\n fieldPassword: 'Password',\n fieldHost: 'Host',\n fieldPort: 'Port',\n fieldApiKey: 'API key',\n fieldSecret: 'Secret',\n fieldAccessToken: 'Access token',\n fieldRefreshToken: 'Refresh token',\n fieldOtpSecret: 'OTP secret',\n fieldUrl: 'URL',\n fieldNotes: 'Notes',\n fieldTags: 'Tags',\n fieldIcon: 'Icon (emoji)',\n fieldColor: 'Color',\n fieldCustom: 'Custom fields (key=value per line)',\n error: 'Something went wrong.',\n kindLogin: 'Login',\n kindSsh: 'SSH',\n kindApiKey: 'API key',\n kindSecret: 'Secret',\n kindOauth: 'OAuth',\n kindCustom: 'Custom',\n} as const\n\nexport type VaultLocaleKey = keyof typeof en\n\n/** Chinese strings (same keys as English). */\nexport const zh: Record<VaultLocaleKey, string> = {\n nav: '凭据库',\n heading: 'Vault 凭据库',\n intro: '本机加密存储的凭据。',\n searchPlaceholder: '搜索标题、用户名、邮箱、主机…',\n loading: '加载中…',\n empty: '还没有凭据,添加一条开始使用。',\n emptyHint: '提示:你可以在对话中把 API Key 或 token 交给助手保存——开启自动捕获后,它会在你同意时帮你存入本库。批量导入?让助手调用 vault_import_csv 并给出 CSV 路径即可。',\n emptyHintReadonly: '当前为只读模式——只能读取凭据,不能在此添加。将 accessMode 改为 \"readwrite\" 即可启用写入。',\n modeLabel: '访问模式',\n autoCaptureLabel: '自动捕获对话中的凭据',\n modeReadonly: '只读',\n modeAsk: '写入前询问',\n modeAuto: '自动读写',\n modeReadonlyHint: '只读 —— 变更已禁用',\n modeAskHint: '写入前询问 —— 每次增/改/删都会征求你的确认',\n modeAutoHint: '自动读写 —— 无需逐次确认',\n autoCaptureOn: '自动捕获已开启',\n autoCaptureOff: '自动捕获已关闭',\n clearSearch: '清除搜索',\n entryCount: '条目数',\n reportTitle: '健康与轮换',\n recentActivity: '最近活动',\n recentlyAdded: '最近添加',\n reportRotation: '已过期 / 待轮换',\n reportWeak: '弱密码',\n reportReused: '跨条目复用的凭据',\n healthOk: '凭据库健康',\n healthBackup: '备份',\n healthStrength: '强度',\n dueExpired: '已过期',\n dueExpiring: '将于',\n dueNow: '待轮换',\n showTrash: '回收站',\n hideTrash: '隐藏回收站',\n trashed: '已删除',\n trashEmpty: '回收站为空',\n restore: '恢复',\n clearTrash: '清空回收站',\n restoreAll: '全部恢复',\n clearTrashConfirm: '永久删除回收站中全部条目?此操作不可撤销。',\n show: '显示',\n hide: '隐藏',\n allKinds: '全部类型',\n allTags: '全部标签',\n sortAlpha: '排序:A–Z',\n sortRecent: '排序:最近',\n highSensitivity: '高敏',\n pinned: '已置顶',\n add: '新增凭据',\n quickAdd: '快速添加',\n cancel: '取消',\n save: '保存',\n edit: '编辑',\n delete: '删除',\n deleteConfirm: '确定删除该条目?此操作不可撤销。',\n copy: '复制',\n copyPassword: '复制密码',\n copyCode: '复制验证码',\n copied: '已复制',\n totp: '验证码',\n fieldTitle: '标题',\n fieldKind: '类型',\n fieldUsername: '用户名',\n fieldEmail: '邮箱',\n fieldPhone: '手机号',\n fieldPassword: '密码',\n fieldHost: '主机',\n fieldPort: '端口',\n fieldApiKey: 'API 密钥',\n fieldSecret: 'Secret',\n fieldAccessToken: '访问令牌',\n fieldRefreshToken: '刷新令牌',\n fieldOtpSecret: 'TOTP 密钥',\n fieldUrl: 'URL',\n fieldNotes: '备注',\n fieldTags: '标签',\n fieldIcon: '图标(emoji)',\n fieldColor: '颜色',\n fieldCustom: '自定义字段(每行 key=value)',\n error: '操作失败。',\n kindLogin: '登录',\n kindSsh: 'SSH',\n kindApiKey: 'API 密钥',\n kindSecret: 'Secret',\n kindOauth: 'OAuth',\n kindCustom: '自定义',\n}\n","/**\n * dsh-vault browser half: a Vault settings page managing encrypted\n * credentials — list, search, add, edit, delete, and copy — through the host\n * VaultGateway remote over the /api RPC channel.\n *\n * @module dsh-vault/client\n */\n\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-api-remotes/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport { VaultSection, type VaultSectionInjected } from './VaultSection.tsx'\nimport type { VaultSectionTypes } from './VaultSection.tsx'\nimport { en, zh, type VaultLocaleKey } from './locales.ts'\n\nexport type { VaultSectionInjected, VaultSectionProps } from './VaultSection.tsx'\nexport type { VaultSectionTypes } from './VaultSection.tsx'\nexport type { VaultLocaleKey } from './locales.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Vault settings page copy. */\n 'settings.vault': VaultLocaleKey\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nexport const NS = 'settings.vault'\n\n/** Services required by the Settings registration and the RPC face. */\nexport const inject = ['slots', 'locale', 'connection']\n\n/**\n * Register the Vault settings section once the `settings.section` declaration\n * is on the ledger. The section talks to the host through the connection RPC\n * channel (endpoints `vault/*` served by the host VaultGateway remote).\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-vault: dictionaries')\n\n const t = ctx.locale.bind(NS)\n const connection = ctx.get('connection') as ConnectionHandle\n\n /** Invoke one host vault remote and normalize the RPC envelope. */\n async function invoke<T>(method: string, args: Record<string, unknown> = {}): Promise<T> {\n const result = await connection.rpc.call('/api', `vault/${method}`, { args })\n if (!result.ok) {\n throw new Error(`vault.${method} failed: ${result.error.code}: ${result.error.message}`)\n }\n return result.value as T\n }\n\n const injected = (): VaultSectionInjected => ({\n t,\n config: () => invoke<VaultSectionTypes['config']>('config'),\n setAccessMode: (mode) => invoke<VaultSectionTypes['config']>('setAccessMode', { mode }),\n setAutoCapture: (enabled) => invoke<VaultSectionTypes['config']>('setAutoCapture', { enabled }),\n list: () => invoke<{ entries: VaultSectionTypes['entries'] }>('list').then(r => r.entries),\n search: (query, limit) => invoke<{ entries: VaultSectionTypes['entries'] }>('search', { query, limit: limit ?? 50 }).then(r => r.entries),\n get: (id) => invoke<{ found: boolean; entry?: VaultSectionTypes['fullEntry'] }>('get', { id }),\n add: (patch) => invoke<VaultSectionTypes['summaryEntry']>('add', { patch }),\n update: (id, patch) => invoke<{ found: boolean; entry?: VaultSectionTypes['summaryEntry'] }>('update', { id, patch }),\n remove: (id) => invoke<{ deleted: boolean }>('delete', { id }),\n trash: () => invoke<{ entries: VaultSectionTypes['entries'] }>('trash').then(r => r.entries),\n rotation: () => invoke<{ entries: unknown[] }>('rotation').then(r => r.entries),\n history: () => invoke<{ events: unknown[] }>('history').then(r => r.events),\n stats: () => invoke<Record<string, unknown>>('stats'),\n recent: () => invoke<{ entries: unknown[] }>('recent').then(r => r.entries),\n backupStatus: () => invoke<{ daysSinceBackup: number; backups: number }>('backupStatus'),\n health: () => invoke<{ weak: unknown[]; reused: unknown[]; strength: { weak: number; fair: number; strong: number } }>('health'),\n restore: (id) => invoke<{ restored: boolean }>('restore', { id }),\n undeleteAll: () => invoke<{ restored: number }>('undeleteAll'),\n totp: (id) => invoke<{ code: string; label?: string; secondsRemaining: number }>('totp', { id }),\n })\n\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: 'vault',\n order: 30,\n label: () => t('nav'),\n inject: injected,\n }, VaultSection))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM;IAC1E,aAAa,OAAgC,OAAO;IACpD,cAAc,OAA+B,QAAQ,CAAC,CAAC,MAAK,MAAK,EAAE,OAAO;IAC1E,oBAAoB,OAAqD,cAAc;IACvF,cAAc,OAAyG,QAAQ;IAC/H,UAAU,OAAO,OAA8B,WAAW,EAAE,GAAG,CAAC;IAChE,mBAAmB,OAA6B,aAAa;IAC7D,OAAO,OAAO,OAAmE,QAAQ,EAAE,GAAG,CAAC;GACjG;GAEA,IAAI,MAAM,OAAO,0BAA0B,IAAI,MAAM,SAAS;IAC5D,MAAM;IACN,IAAI;IACJ,OAAO;IACP,aAAa,EAAE,KAAK;IACpB,QAAQ;GACV,GAAG,YAAY,CAAC;EAClB"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["css"],"sources":["../src/client/VaultSection.tsx","../src/client/locales.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Vault settings section: list, search, add, edit, delete, and copy encrypted\n * credentials. All mutations go through the host VaultGateway remote; secrets\n * are shown only inside the edit form or a copy action, never in the list.\n */\n\nimport { useEffect, useId, useMemo, useState, type ReactNode } from 'react'\nimport type { PropsLocale, PropsRuntime, InjectFace, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { VaultLocaleKey } from './locales.ts'\nimport css from './VaultSection.module.css'\n\n/** Wire shapes shared with the host gateway (mirror of src/index.ts types). */\nexport interface VaultSummaryWire {\n id: string\n title: string\n sensitivity?: string\n kind?: string\n username?: string\n email?: string\n phone?: string\n host?: string\n port?: string\n url?: string\n tags?: string[]\n}\n\nexport interface VaultFullWire {\n id: string\n title: string\n kind?: string\n username?: string\n email?: string\n phone?: string\n password?: string\n host?: string\n port?: string\n privateKey?: string\n apiKey?: string\n secret?: string\n accessToken?: string\n refreshToken?: string\n expiresAt?: number\n rotationDays?: number\n sensitivity?: string\n favorite?: boolean\n otpSecret?: string\n url?: string\n notes?: string\n tags?: string[]\n icon?: string\n color?: string\n fields?: Record<string, unknown>\n}\n\n/** Patch shape accepted by vault.add / vault.update. */\nexport type VaultPatch = Partial<Omit<VaultFullWire, 'id'>>\n\n/** Registration-side business face supplied by the plugin entry. */\nexport interface VaultSectionInjected {\n t: TranslateNS<'settings.vault'>\n config: () => Promise<{ accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean }>\n setAccessMode: (mode: 'readonly' | 'ask' | 'auto') => Promise<{ accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean }>\n setAutoCapture: (enabled: boolean) => Promise<{ accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean }>\n list: () => Promise<VaultSummaryWire[]>\n search: (query: string, limit?: number) => Promise<VaultSummaryWire[]>\n get: (id: string) => Promise<{ found: boolean; entry?: VaultFullWire }>\n add: (patch: VaultPatch & { title: string }) => Promise<VaultSummaryWire>\n update: (id: string, patch: VaultPatch) => Promise<{ found: boolean; entry?: VaultSummaryWire }>\n remove: (id: string) => Promise<{ deleted: boolean }>\n trash: () => Promise<VaultSummaryWire[]>\n rotation: () => Promise<unknown[]>\n history: () => Promise<unknown[]>\n stats: () => Promise<Record<string, unknown>>\n recent: () => Promise<unknown[]>\n backupStatus: () => Promise<{ daysSinceBackup: number; backups: number }>\n backup: (maxBackups?: number) => Promise<{ path: string; kept: number; pruned: number }>\n health: () => Promise<{ weak: unknown[]; reused: unknown[]; strength: { weak: number; fair: number; strong: number } }>\n restore: (id: string) => Promise<{ restored: boolean }>\n undeleteAll: () => Promise<{ restored: number }>\n totp: (id: string) => Promise<{ code: string; label?: string; secondsRemaining: number }>\n}\n\n/** Type-level alias so consumers can reference the wire shapes without values. */\nexport type VaultSectionTypes = {\n entries: VaultSummaryWire[]\n fullEntry: VaultFullWire\n summaryEntry: VaultSummaryWire\n config: { accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean }\n accessModes: Array<'readonly' | 'ask' | 'auto'>\n}\n\n/** Full component props assembled by the Settings slot renderer. */\nexport type VaultSectionProps =\n PropsRuntime<'settings.section'>\n & PropsLocale<'settings.vault'>\n & InjectFace<VaultSectionInjected>\n\n/** The editable form fields we render (subset of the full wire). */\ntype FormFields = {\n title?: string | undefined\n kind?: string | undefined\n username?: string | undefined\n email?: string | undefined\n phone?: string | undefined\n password?: string | undefined\n host?: string | undefined\n port?: string | undefined\n privateKey?: string | undefined\n apiKey?: string | undefined\n secret?: string | undefined\n accessToken?: string | undefined\n refreshToken?: string | undefined\n otpSecret?: string | undefined\n url?: string | undefined\n notes?: string | undefined\n icon?: string | undefined\n color?: string | undefined\n expiresAt?: number | undefined\n rotationDays?: number | undefined\n sensitivity?: string | undefined\n favorite?: boolean | undefined\n}\n\nconst FORM_FIELDS: Array<{ key: keyof FormFields; label: VaultLocaleKey }> = [\n { key: 'title', label: 'fieldTitle' },\n { key: 'kind', label: 'fieldKind' },\n { key: 'username', label: 'fieldUsername' },\n { key: 'email', label: 'fieldEmail' },\n { key: 'phone', label: 'fieldPhone' },\n { key: 'password', label: 'fieldPassword' },\n { key: 'host', label: 'fieldHost' },\n { key: 'port', label: 'fieldPort' },\n { key: 'apiKey', label: 'fieldApiKey' },\n { key: 'secret', label: 'fieldSecret' },\n { key: 'accessToken', label: 'fieldAccessToken' },\n { key: 'refreshToken', label: 'fieldRefreshToken' },\n { key: 'otpSecret', label: 'fieldOtpSecret' },\n { key: 'url', label: 'fieldUrl' },\n { key: 'notes', label: 'fieldNotes' },\n { key: 'expiresAt', label: 'fieldExpiresAt' },\n { key: 'rotationDays', label: 'fieldRotationDays' },\n { key: 'sensitivity', label: 'fieldSensitivity' },\n { key: 'favorite', label: 'fieldFavorite' },\n { key: 'icon', label: 'fieldIcon' },\n { key: 'color', label: 'fieldColor' },\n]\n\nconst KIND_KEYS: Record<string, VaultLocaleKey> = {\n login: 'kindLogin',\n ssh: 'kindSsh',\n 'api-key': 'kindApiKey',\n secret: 'kindSecret',\n oauth: 'kindOauth',\n custom: 'kindCustom',\n}\n\ntype ViewState =\n | { readonly status: 'loading' }\n | { readonly status: 'error' }\n | { readonly status: 'ready'; readonly entries: VaultSummaryWire[] }\n\ntype EditorState =\n | { readonly status: 'closed' }\n | { readonly status: 'creating' }\n | { readonly status: 'editing'; readonly entry: VaultFullWire }\n\nfunction emptyForm(): FormFields {\n return { title: '', kind: 'login', username: '', email: '', phone: '', password: '', host: '', port: '', icon: '', color: '' }\n}\n\n/** Render the Vault settings section. */\nexport function VaultSection(props: VaultSectionProps): ReactNode {\n const { t, config, setAccessMode, setAutoCapture, list, search, get, add, update, remove, trash, rotation, health, history, stats, backupStatus, backup, recent, restore, undeleteAll, totp } = props\n const searchId = useId()\n const [query, setQuery] = useState('')\n const [state, setState] = useState<ViewState>({ status: 'loading' })\n const [editor, setEditor] = useState<EditorState>({ status: 'closed' })\n const [form, setForm] = useState<FormFields>(emptyForm())\n const [busy, setBusy] = useState(false)\n const [message, setMessage] = useState<string | null>(null)\n const [copiedId, setCopiedId] = useState<string | null>(null)\n const [codeMap, setCodeMap] = useState<Record<string, string>>({})\n const [tagsDraft, setTagsDraft] = useState('')\n const [fieldsDraft, setFieldsDraft] = useState('')\n const [revealed, setRevealed] = useState<Record<string, boolean>>({})\n const [kindFilter, setKindFilter] = useState('')\n const [tagFilter, setTagFilter] = useState('')\n const [expandedId, setExpandedId] = useState<string | null>(null)\n const [sortBy, setSortBy] = useState<'alpha' | 'recent'>('alpha')\n const [policy, setPolicy] = useState<{ accessMode: 'readonly' | 'ask' | 'auto'; autoCapture: boolean } | null>(null)\n const [showTrash, setShowTrash] = useState(false)\n const [trashEntries, setTrashEntries] = useState<VaultSummaryWire[]>([])\n const [report, setReport] = useState<{ rotation: unknown[]; weak: unknown[]; reused: unknown[]; strength: { weak: number; fair: number; strong: number } | null } | null>(null)\n const [dueMap, setDueMap] = useState<Record<string, { due: string; daysLeft: number }>>({})\n const [recentEvents, setRecentEvents] = useState<Array<Record<string, unknown>>>([])\n const [vaultStats, setVaultStats] = useState<Record<string, unknown> | null>(null)\n const [backupInfo, setBackupInfo] = useState<{ daysSinceBackup: number; backups: number } | null>(null)\n const [recentEntries, setRecentEntries] = useState<Array<Record<string, unknown>>>([])\n\n const readonly = policy?.accessMode === 'readonly'\n\n /** Run an encrypted backup now and refresh the backup-age badge. */\n async function backupNow(): Promise<void> {\n setBusy(true)\n setMessage(null)\n try {\n const result = await backup(10)\n setBackupInfo({ daysSinceBackup: 0, backups: result.kept })\n setMessage(`${t('backupDone')} (${result.kept} kept, ${result.pruned} pruned)`)\n void refresh()\n } catch {\n setMessage(t('error'))\n } finally {\n setBusy(false)\n }\n }\n\n useEffect(() => {\n let current = true\n void config().then(\n value => { if (current) setPolicy(value) },\n () => { /* policy is informational; ignore failures */ },\n )\n return () => { current = false }\n }, [config])\n\n const refresh = useMemo(() => async () => {\n setState({ status: 'loading' })\n try {\n const entries = query.trim().length === 0\n ? await list()\n : await search(query.trim())\n setState({ status: 'ready', entries })\n } catch {\n setState({ status: 'error' })\n }\n }, [list, search, query])\n\n useEffect(() => {\n let current = true\n const timer = window.setTimeout(() => {\n void refresh().then(\n () => { /* state already set inside refresh */ },\n () => { if (current) setState({ status: 'error' }) },\n )\n }, 250)\n return () => { current = false; window.clearTimeout(timer) }\n // refresh is memoized on query (debounced); list/search are stable.\n }, [refresh])\n\n // Vault health & meta: load once on mount (stats, backup age, rotation,\n // weak/reused scan, recent activity) and refresh on window focus.\n useEffect(() => {\n let current = true\n const load = (): void => {\n void Promise.all([\n stats().catch(() => null),\n backupStatus().catch(() => null),\n rotation().catch(() => []),\n health().catch(() => null),\n recent().catch(() => []),\n ]).then(([st, bk, rot, hl, rc]) => {\n if (!current) return\n if (st !== null) setVaultStats(st as Record<string, unknown>)\n if (bk !== null) setBackupInfo(bk)\n setReport({ rotation: (rot ?? []) as unknown[], weak: ((hl?.weak ?? []) as unknown[]), reused: ((hl?.reused ?? []) as unknown[]), strength: (hl?.strength ?? null) as { weak: number; fair: number; strong: number } | null })\n const due: Record<string, { due: string; daysLeft: number }> = {}\n for (const item of (rot ?? []) as Array<{ id?: string; due?: string; daysLeft?: number }>) {\n if (item.id !== undefined && item.due !== undefined) due[item.id] = { due: item.due, daysLeft: item.daysLeft ?? 0 }\n }\n setDueMap(due)\n setRecentEntries((rc ?? []) as Array<Record<string, unknown>>)\n })\n }\n load()\n const onFocus = (): void => { load() }\n window.addEventListener('focus', onFocus)\n return () => { current = false; window.removeEventListener('focus', onFocus) }\n }, [stats, backupStatus, rotation, health, recent])\n\n /** Open the editor for a new entry. */\n function startCreate(): void {\n setForm(emptyForm())\n setTagsDraft('')\n setFieldsDraft('')\n setMessage(null)\n setEditor({ status: 'creating' })\n }\n\n /** Open the editor for an existing entry (fetches full secrets). */\n async function startEdit(id: string): Promise<void> {\n setBusy(true)\n setMessage(null)\n try {\n const result = await get(id)\n if (!result.found || result.entry === undefined) {\n setMessage(t('error'))\n return\n }\n const entry = result.entry\n setForm({\n title: entry.title ?? '',\n kind: entry.kind ?? 'login',\n username: entry.username ?? '',\n email: entry.email ?? '',\n phone: entry.phone ?? '',\n password: entry.password ?? '',\n host: entry.host ?? '',\n port: entry.port ?? '',\n privateKey: entry.privateKey ?? '',\n apiKey: entry.apiKey ?? '',\n secret: entry.secret ?? '',\n accessToken: entry.accessToken ?? '',\n refreshToken: entry.refreshToken ?? '',\n otpSecret: entry.otpSecret ?? '',\n url: entry.url ?? '',\n notes: entry.notes ?? '',\n icon: entry.icon ?? '',\n color: entry.color ?? '',\n expiresAt: entry.expiresAt,\n rotationDays: entry.rotationDays,\n sensitivity: entry.sensitivity,\n favorite: entry.favorite ?? false,\n })\n setTagsDraft((entry.tags ?? []).join(', '))\n setFieldsDraft(entry.fields !== undefined ? Object.entries(entry.fields).map(([k, v]) => `${k}=${String(v)}`).join('\\n') : '')\n setEditor({ status: 'editing', entry })\n } catch {\n setMessage(t('error'))\n } finally {\n setBusy(false)\n }\n }\n\n /** Save the current form (create or update). */\n async function save(): Promise<void> {\n if (!(form.title ?? '').trim()) {\n setMessage(t('error'))\n return\n }\n setBusy(true)\n setMessage(null)\n try {\n const tags = tagsDraft.split(',').map(x => x.trim()).filter(x => x.length > 0)\n const fields: Record<string, string> = {}\n for (const line of fieldsDraft.split('\\n')) {\n const trimmed = line.trim()\n if (trimmed.length === 0) continue\n const eq = trimmed.indexOf('=')\n if (eq <= 0) continue\n fields[trimmed.slice(0, eq).trim()] = trimmed.slice(eq + 1).trim()\n }\n const patch: VaultPatch = {\n title: (form.title ?? '').trim(),\n ...(form.kind !== undefined ? { kind: form.kind } : {}),\n ...(form.username !== undefined ? { username: form.username } : {}),\n ...(form.email !== undefined ? { email: form.email } : {}),\n ...(form.phone !== undefined ? { phone: form.phone } : {}),\n ...(form.password !== undefined ? { password: form.password } : {}),\n ...(form.host !== undefined ? { host: form.host } : {}),\n ...(form.port !== undefined ? { port: form.port } : {}),\n ...(form.privateKey !== undefined ? { privateKey: form.privateKey } : {}),\n ...(form.apiKey !== undefined ? { apiKey: form.apiKey } : {}),\n ...(form.secret !== undefined ? { secret: form.secret } : {}),\n ...(form.accessToken !== undefined ? { accessToken: form.accessToken } : {}),\n ...(form.refreshToken !== undefined ? { refreshToken: form.refreshToken } : {}),\n ...(form.otpSecret !== undefined ? { otpSecret: form.otpSecret } : {}),\n ...(form.url !== undefined ? { url: form.url } : {}),\n ...(form.notes !== undefined ? { notes: form.notes } : {}),\n ...(form.icon !== undefined ? { icon: form.icon } : {}),\n ...(form.color !== undefined ? { color: form.color } : {}),\n ...(form.expiresAt !== undefined ? { expiresAt: form.expiresAt } : {}),\n ...(form.rotationDays !== undefined ? { rotationDays: form.rotationDays } : {}),\n ...(form.sensitivity !== undefined ? { sensitivity: form.sensitivity } : {}),\n ...(form.favorite !== undefined ? { favorite: form.favorite } : {}),\n // Always send tags: an empty array clears them, and the host store\n // treats empty string values as \"clear this field\" too.\n tags,\n fields,\n }\n if (editor.status === 'creating') {\n await add(patch as VaultPatch & { title: string })\n } else if (editor.status === 'editing') {\n await update(editor.entry.id, patch)\n }\n setEditor({ status: 'closed' })\n await refresh()\n } catch {\n setMessage(t('error'))\n } finally {\n setBusy(false)\n }\n }\n\n /** Delete an entry after confirmation. */\n async function removeEntry(id: string): Promise<void> {\n if (!window.confirm(t('deleteConfirm'))) return\n setBusy(true)\n try {\n await remove(id)\n await refresh()\n } catch {\n setMessage(t('error'))\n } finally {\n setBusy(false)\n }\n }\n\n /** Copy a field value to the clipboard and flash the row. */\n async function copyValue(id: string, value: string): Promise<void> {\n try {\n await navigator.clipboard.writeText(value)\n } catch {\n // Clipboard may be blocked; fall back to a temporary textarea.\n const textarea = document.createElement('textarea')\n textarea.value = value\n document.body.appendChild(textarea)\n textarea.select()\n document.execCommand('copy')\n textarea.remove()\n }\n setCopiedId(id)\n window.setTimeout(() => setCopiedId(null), 1500)\n }\n\n /** Fetch and display a TOTP code for an entry with an otpSecret. */\n async function showTotp(id: string): Promise<void> {\n setBusy(true)\n try {\n const result = await totp(id)\n setCodeMap(previous => ({ ...previous, [id]: `${result.code} (${result.secondsRemaining}s)` }))\n } catch {\n setCodeMap(previous => ({ ...previous, [id]: t('error') }))\n } finally {\n setBusy(false)\n }\n }\n\n /** Field-set summary line for one entry (non-secret). */\n function kindIcon(kind?: string): string {\n switch (kind ?? 'login') {\n case 'ssh': return '🖥️'\n case 'api-key': return '🔑'\n case 'oauth': return '🔐'\n case 'secret': return '🤫'\n case 'custom': return '🧩'\n default: return '👤'\n }\n }\n\n function identityLine(entry: VaultSummaryWire): string {\n const parts = [\n entry.kind !== undefined ? t(KIND_KEYS[entry.kind] ?? 'kindCustom') : t('kindLogin'),\n entry.username,\n entry.email,\n entry.phone,\n entry.host !== undefined ? `${entry.host}${entry.port !== undefined ? `:${entry.port}` : ''}` : undefined,\n entry.url,\n ].filter((value): value is string => value !== undefined && value.length > 0)\n return parts.join(' · ')\n }\n\n return (\n <section className={css.section} aria-labelledby=\"vault-heading\">\n <h2 id=\"vault-heading\">{t('heading')}</h2>\n <p className={css.intro}>{t('intro')}</p>\n\n <div className={css.toolbar}>\n <label className={css.searchBox}>\n <span className=\"sr-only\">{t('searchPlaceholder')}</span>\n <input\n id={searchId}\n type=\"search\"\n placeholder={t('searchPlaceholder')}\n value={query}\n onChange={event => setQuery(event.target.value)}\n />\n {query.length > 0 && (\n <button type=\"button\" className={css.clearButton} onClick={() => setQuery('')} aria-label={t('clearSearch')}>×</button>\n )}\n </label>\n <select className={css.kindFilter} value={kindFilter} onChange={e => setKindFilter(e.target.value)} aria-label={t('fieldKind')}>\n <option value=\"\">{t('allKinds')}</option>\n {Object.entries(KIND_KEYS).map(([value, key]) => (\n <option key={value} value={value}>{t(key)}</option>\n ))}\n </select>\n <select className={css.kindFilter} value={tagFilter} onChange={e => setTagFilter(e.target.value)} aria-label={t('fieldTags')}>\n <option value=\"\">{t('allTags')}</option>\n {[...new Set(state.status === 'ready' ? state.entries.flatMap(e => e.tags ?? []) : [])].sort().map(tag => (\n <option key={tag} value={tag}>{tag}</option>\n ))}\n </select>\n <button\n type=\"button\"\n className={css.sortButton}\n onClick={() => setSortBy(sortBy === 'alpha' ? 'recent' : 'alpha')}\n >{sortBy === 'alpha' ? t('sortAlpha') : t('sortRecent')}</button>\n <button type=\"button\" className={css.addButton} onClick={startCreate} disabled={busy || readonly}>\n + {t('add')}\n </button>\n </div>\n\n {policy !== null && (\n <div className={css.policyBar}>\n <label className={css.policyField}>\n <span>{t('modeLabel')}</span>\n <select\n value={policy.accessMode}\n disabled={busy}\n onChange={event => {\n const next = event.target.value as 'readonly' | 'ask' | 'auto'\n setBusy(true)\n setMessage(null)\n void setAccessMode(next).then(\n value => { setPolicy(value); setBusy(false) },\n () => { setMessage(t('error')); setBusy(false) },\n )\n }}\n >\n <option value=\"readonly\">{t('modeReadonly')}</option>\n <option value=\"ask\">{t('modeAsk')}</option>\n <option value=\"auto\">{t('modeAuto')}</option>\n </select>\n </label>\n <label className={css.policyField}>\n <span>{t('autoCaptureLabel')}</span>\n <input\n type=\"checkbox\"\n checked={policy.autoCapture}\n disabled={busy}\n onChange={event => {\n const next = event.target.checked\n setBusy(true)\n setMessage(null)\n void setAutoCapture(next).then(\n value => { setPolicy(value); setBusy(false) },\n () => { setMessage(t('error')); setBusy(false) },\n )\n }}\n />\n </label>\n <p className={policy.accessMode === 'readonly' ? css.modeReadonly : policy.accessMode === 'ask' ? css.modeAsk : css.modeAuto}>\n {policy.accessMode === 'readonly'\n ? t('modeReadonlyHint')\n : policy.accessMode === 'ask'\n ? t('modeAskHint')\n : t('modeAutoHint')}\n {policy.autoCapture ? ` · ${t('autoCaptureOn')}` : ` · ${t('autoCaptureOff')}`}\n </p>\n </div>\n )}\n\n {message !== null && <p role=\"alert\" className={css.error}>{message}</p>}\n\n {state.status === 'loading' && <p className={css.status}>{t('loading')}</p>}\n {state.status === 'error' && <p role=\"alert\" className={css.error}>{t('error')}</p>}\n {state.status === 'ready' && state.entries.length === 0 && (\n <div className={css.emptyBox}>\n <p className={css.empty}>{t('empty')}</p>\n <p className={css.emptyHint}>{readonly ? t('emptyHintReadonly') : t('emptyHint')}</p>\n {!readonly && (\n <button type=\"button\" className={css.addButton} onClick={startCreate}>{t('quickAdd')}</button>\n )}\n </div>\n )}\n\n {recentEntries.length > 0 && (\n <div className={css.reportBox}>\n <p className={css.reportTitle}>{t('recentlyAdded')}</p>\n {recentEntries.map((e, i) => (\n <p key={i} className={css.reportLine}>{String(e.title ?? '')}</p>\n ))}\n </div>\n )}\n\n {recentEvents.length > 0 && (\n <div className={css.reportBox}>\n <p className={css.reportTitle}>{t('recentActivity')}</p>\n {recentEvents.map((ev, i) => (\n <p key={i} className={css.reportLine}>\n {String(ev.action ?? '')} · {String(ev.title ?? ev.id ?? '')}\n </p>\n ))}\n </div>\n )}\n\n {report !== null && (report.rotation.length > 0 || report.weak.length > 0 || report.reused.length > 0) && (\n <div className={css.reportBox}>\n <p className={css.reportTitle}>{t('reportTitle')}</p>\n {report.rotation.length > 0 && (\n <>\n <p className={css.reportLine}>{t('reportRotation')}: {report.rotation.length}</p>\n {(report.rotation as Array<{ title?: string; due?: string; daysLeft?: number }>).slice(0, 8).map((item, i) => (\n <p key={i} className={css.reportSub}>\n · {String(item.title ?? '?')}{item.due === 'expired' ? ` (${t('dueExpired')})` : item.due === 'soon' ? ` (${t('dueExpiring')} ${item.daysLeft ?? 0}d)` : ` (${t('dueNow')})`}\n </p>\n ))}\n </>\n )}\n {report.weak.length > 0 && (\n <p className={css.reportLine}>{t('reportWeak')}: {report.weak.length}</p>\n )}\n {report.reused.length > 0 && (\n <p className={css.reportLine}>{t('reportReused')}: {report.reused.length}</p>\n )}\n </div>\n )}\n\n {state.status === 'ready' && (state.entries.length > 0 || trashEntries.length > 0) && (\n <button\n type=\"button\"\n className={css.trashButton}\n onClick={() => {\n if (!showTrash) void trash().then(setTrashEntries)\n setShowTrash(!showTrash)\n }}\n >{showTrash ? t('hideTrash') : t('showTrash')}{trashEntries.length > 0 ? ` (${trashEntries.length})` : ''}</button>\n )}\n\n {showTrash && (\n <ul className={css.list}>\n {trashEntries.map(entry => (\n <li key={entry.id} className={css.row}>\n <div className={css.rowMain}>\n <span className={css.title}>{entry.title}</span>\n <span className={css.identity}>{t('trashed')}</span>\n </div>\n <div className={css.rowActions}>\n <button\n type=\"button\"\n onClick={() => { void restore(entry.id).then(() => { void trash().then(setTrashEntries); void refresh() }) }}\n disabled={busy || readonly}\n >{t('restore')}</button>\n </div>\n </li>\n ))}\n {trashEntries.length === 0 && <p className={css.empty}>{t('trashEmpty')}</p>}\n </ul>\n )}\n {showTrash && trashEntries.length > 0 && (\n <>\n <button\n type=\"button\"\n className={css.trashButton}\n onClick={() => {\n setBusy(true)\n void undeleteAll().then(() => {\n void trash().then(setTrashEntries)\n void refresh()\n setBusy(false)\n }, () => setBusy(false))\n }}\n disabled={busy || readonly}\n >{t('restoreAll')}</button>\n <button\n type=\"button\"\n className={css.dangerButton}\n onClick={() => {\n if (!window.confirm(t('clearTrashConfirm'))) return\n setBusy(true)\n void Promise.all(trashEntries.map(e => remove(e.id))).then(() => {\n void trash().then(setTrashEntries)\n void refresh()\n setBusy(false)\n }, () => setBusy(false))\n }}\n disabled={busy || readonly}\n >{t('clearTrash')}</button>\n </>\n )}\n\n {state.status === 'ready' && state.entries.length > 0 && (\n <ul className={css.list}>\n {state.entries.filter(entry => (kindFilter === '' || entry.kind === kindFilter) && (tagFilter === '' || (entry.tags ?? []).includes(tagFilter))).sort((a, b) => sortBy === 'alpha' ? a.title.localeCompare(b.title) : 0).map(entry => {\n const code = codeMap[entry.id]\n return (\n <li key={entry.id} className={`${css.row}${dueMap[entry.id] !== undefined ? ` ${dueMap[entry.id]!.due === 'expired' ? css.rowExpired : css.rowDue}` : ''}`}>\n <div className={css.rowMain} onClick={() => setExpandedId(expandedId === entry.id ? null : entry.id)}>\n <span className={css.title}>\n <span className={css.kindIcon}>{kindIcon(entry.kind)}</span>\n {(entry as VaultSummaryWire & { favorite?: boolean }).favorite && (\n <span className={css.pinStar} title={t('pinned')}>★</span>\n )}\n {entry.title}\n {(entry as VaultSummaryWire & { sensitivity?: string }).sensitivity === 'high' && (\n <span className={css.highBadge}>{t('highSensitivity')}</span>\n )}\n {dueMap[entry.id] !== undefined && (\n <span className={`${css.dueBadge} ${dueMap[entry.id]!.due === 'expired' ? css.badgeDanger : css.badgeWarn}`}>\n {dueMap[entry.id]!.due === 'expired' ? t('dueExpired') : dueMap[entry.id]!.due === 'soon' ? `${t('dueExpiring')} ${dueMap[entry.id]!.daysLeft}d` : t('dueNow')}\n </span>\n )}\n </span>\n <span className={css.identity}>{identityLine(entry)}</span>\n {code !== undefined && <span className={css.totp}>{code}</span>}\n </div>\n {expandedId === entry.id && (\n <div className={css.detailBox}>\n {Object.entries(entry).filter(([k]) => !['id', 'title'].includes(k) && entry[k as keyof VaultSummaryWire] !== undefined).map(([k, v]) => (\n <span key={k} className={css.detailItem}>\n <strong>{k}</strong>: {Array.isArray(v) ? v.join(', ') : String(v)}\n </span>\n ))}\n </div>\n )}\n <div className={css.rowActions}>\n {copiedId === entry.id && <span className={css.copied}>{t('copied')}</span>}\n <button\n type=\"button\"\n onClick={() => void copyValue(entry.id, entry.username ?? entry.title)}\n disabled={busy}\n >{t('copy')}</button>\n <button\n type=\"button\"\n onClick={() => {\n setBusy(true)\n void get(entry.id).then(r => {\n if (r.found && r.entry?.password) void copyValue(entry.id, r.entry.password)\n setBusy(false)\n }, () => setBusy(false))\n }}\n disabled={busy || readonly}\n >{t('copyPassword')}</button>\n <button type=\"button\" onClick={() => void showTotp(entry.id)} disabled={busy}>{t('totp')}</button>\n {code !== undefined && (\n <button type=\"button\" onClick={() => void copyValue(entry.id, code.split(' ')[0]!)} disabled={busy}>{t('copyCode')}</button>\n )}\n <button type=\"button\" onClick={() => void startEdit(entry.id)} disabled={busy || readonly}>{t('edit')}</button>\n <button\n type=\"button\"\n className={css.deleteButton}\n onClick={() => void removeEntry(entry.id)}\n disabled={busy || readonly}\n >{t('delete')}</button>\n </div>\n </li>\n )\n })}\n </ul>\n )}\n\n {state.status === 'ready' && (\n <div className={css.healthBar}>\n {vaultStats !== null && typeof vaultStats.total === 'number' && (\n <span className={css.badge}>{t('entryCount')}: {String(vaultStats.total)}</span>\n )}\n {vaultStats !== null && typeof vaultStats.withTotp === 'number' && (\n <span className={css.badge}>TOTP: {String(vaultStats.withTotp)}</span>\n )}\n {vaultStats !== null && typeof vaultStats.highSensitivity === 'number' && (\n <span className={css.badge}>{t('highSensitivity')}: {String(vaultStats.highSensitivity)}</span>\n )}\n {report !== null && report.strength !== null && (\n <span className={`${css.badge} ${report.strength.weak > 0 ? css.badgeDanger : css.badgeOk}`}>\n {t('healthStrength')}: {report.strength.weak}W/{report.strength.fair}F/{report.strength.strong}S\n </span>\n )}\n {report !== null && report.rotation.length > 0 && (\n <span className={`${css.badge} ${css.badgeWarn}`}>{t('reportRotation')}: {report.rotation.length}</span>\n )}\n {report !== null && report.weak.length > 0 && (\n <span className={`${css.badge} ${css.badgeDanger}`}>{t('reportWeak')}: {report.weak.length}</span>\n )}\n {report !== null && report.reused.length > 0 && (\n <span className={`${css.badge} ${css.badgeDanger}`}>{t('reportReused')}: {report.reused.length}</span>\n )}\n {report !== null && report.rotation.length === 0 && report.weak.length === 0 && report.reused.length === 0 && (\n <span className={`${css.badge} ${css.badgeOk}`}>{t('healthOk')}</span>\n )}\n {backupInfo !== null && backupInfo.daysSinceBackup >= 0 && (\n <span className={`${css.badge} ${backupInfo.daysSinceBackup > 14 ? css.badgeDanger : backupInfo.daysSinceBackup > 7 ? css.badgeWarn : ''}`}>\n {t('healthBackup')}: {backupInfo.daysSinceBackup}d\n </span>\n )}\n <button type=\"button\" className={css.backupButton} onClick={() => void backupNow()} disabled={busy}>\n {t('backupNow')}\n </button>\n </div>\n )}\n {state.status === 'ready' && (\n <p className={css.footer}>\n {t('entryCount')}: {state.entries.length}\n {vaultStats !== null && typeof vaultStats.withTotp === 'number' && ` · TOTP: ${String(vaultStats.withTotp)}`}\n {vaultStats !== null && typeof vaultStats.highSensitivity === 'number' && ` · ${t('highSensitivity')}: ${String(vaultStats.highSensitivity)}`}\n {backupInfo !== null && backupInfo.daysSinceBackup >= 0 && ` · backup: ${backupInfo.daysSinceBackup}d ago`}\n {vaultStats !== null && typeof vaultStats.byTag === 'object' && vaultStats.byTag !== null\n && Object.keys(vaultStats.byTag as Record<string, unknown>).length > 0\n && ` · tags: ${Object.entries(vaultStats.byTag as Record<string, unknown>).map(([k, v]) => `${k}(${String(v)})`).join(' ')}`}\n </p>\n )}\n\n {editor.status !== 'closed' && (\n <div className={css.editor} role=\"dialog\" aria-label={editor.status === 'creating' ? t('add') : t('edit')}>\n <div className={css.editorBody}>\n {FORM_FIELDS.map(field => (\n <label key={field.key} className={css.field}>\n <span>{t(field.label)}</span>\n {field.key === 'kind' ? (\n <select\n value={form.kind ?? 'login'}\n onChange={event => setForm(previous => ({ ...previous, kind: event.target.value }))}\n >\n {Object.entries(KIND_KEYS).map(([value, key]) => (\n <option key={value} value={value}>{t(key)}</option>\n ))}\n </select>\n ) : field.key === 'title' ? (\n <input\n value={form.title ?? ''}\n onChange={event => setForm(previous => ({ ...previous, title: event.target.value }))}\n />\n ) : field.key === 'password' || field.key === 'otpSecret' || field.key === 'apiKey'\n || field.key === 'secret' || field.key === 'accessToken' || field.key === 'refreshToken'\n || field.key === 'privateKey' ? (\n <span className={css.secretField}>\n <input\n type={revealed[field.key] ? 'text' : 'password'}\n value={(form[field.key] as string | undefined) ?? ''}\n onChange={event => setForm(previous => ({ ...previous, [field.key]: event.target.value }))}\n />\n <button\n type=\"button\"\n className={css.revealButton}\n onClick={() => setRevealed(previous => ({ ...previous, [field.key]: !previous[field.key] }))}\n >{revealed[field.key] ? t('hide') : t('show')}</button>\n </span>\n ) : field.key === 'expiresAt' ? (\n <input\n type=\"datetime-local\"\n value={form.expiresAt !== undefined ? new Date(form.expiresAt).toISOString().slice(0, 16) : ''}\n onChange={event => {\n const raw = event.target.value\n const epoch = raw.length > 0 ? Date.parse(raw) : NaN\n setForm(previous => ({ ...previous, expiresAt: Number.isNaN(epoch) ? undefined : epoch }))\n }}\n />\n ) : field.key === 'rotationDays' ? (\n <input\n type=\"number\"\n min={0}\n max={3650}\n placeholder={t('rotationClearHint')}\n value={form.rotationDays ?? ''}\n onChange={event => {\n const raw = event.target.value\n setForm(previous => ({ ...previous, rotationDays: raw.length > 0 ? Number(raw) : undefined }))\n }}\n />\n ) : field.key === 'sensitivity' ? (\n <select\n value={form.sensitivity ?? 'normal'}\n onChange={event => setForm(previous => ({ ...previous, sensitivity: event.target.value === 'high' ? 'high' : 'normal' }))}\n >\n <option value=\"normal\">{t('sensitivityNormal')}</option>\n <option value=\"high\">{t('sensitivityHigh')}</option>\n </select>\n ) : field.key === 'favorite' ? (\n <label className={css.checkField}>\n <input\n type=\"checkbox\"\n checked={form.favorite ?? false}\n onChange={event => setForm(previous => ({ ...previous, favorite: event.target.checked }))}\n />\n {t('favoriteHint')}\n </label>\n ) : (\n <input\n type=\"text\"\n value={(form[field.key] as string | undefined) ?? ''}\n onChange={event => setForm(previous => ({ ...previous, [field.key]: event.target.value }))}\n />\n )}\n </label>\n ))}\n <label className={css.field}>\n <span>{t('fieldTags')}</span>\n <input\n value={tagsDraft}\n onChange={event => setTagsDraft(event.target.value)}\n placeholder=\"dev, prod\"\n />\n </label>\n <label className={css.field}>\n <span>{t('fieldCustom')}</span>\n <textarea\n value={fieldsDraft}\n onChange={event => setFieldsDraft(event.target.value)}\n rows={3}\n placeholder=\"region=us-east-1 team=infra\"\n />\n </label>\n </div>\n <div className={css.editorActions}>\n <button type=\"button\" onClick={() => setEditor({ status: 'closed' })} disabled={busy}>{t('cancel')}</button>\n <button type=\"button\" className={css.saveButton} onClick={() => void save()} disabled={busy}>{t('save')}</button>\n </div>\n </div>\n )}\n </section>\n )\n}\n","/** Copy dictionaries for the Vault settings section. */\n\n/** English strings (the key-set source of truth for this pair). */\nexport const en = {\n nav: 'Vault',\n heading: 'Vault',\n intro: 'Encrypted credentials stored on this machine.',\n searchPlaceholder: 'Search title, username, email, host…',\n loading: 'Loading…',\n empty: 'No credentials yet. Add one to get started.',\n emptyHint: 'Tip: you can ask the assistant to save an API key or token you share in chat — with auto-capture on it offers to store it for you. Bulk importing? Ask for vault_import_csv with a CSV file path.',\n emptyHintReadonly: 'The vault is in readonly mode — credentials can be read but not added here. Switch accessMode to \"readwrite\" to enable writes.',\n modeLabel: 'Access mode',\n autoCaptureLabel: 'Auto-capture credentials from chat',\n modeReadonly: 'Read-only',\n modeAsk: 'Ask before writing',\n modeAuto: 'Automatic read-write',\n modeReadonlyHint: 'Read-only — mutations disabled',\n modeAskHint: 'Prompt before writing — every add/update/delete asks you',\n modeAutoHint: 'Automatic read-write — no per-call prompt',\n autoCaptureOn: 'auto-capture on',\n autoCaptureOff: 'auto-capture off',\n clearSearch: 'Clear search',\n entryCount: 'Entries',\n reportTitle: 'Health & rotation',\n recentActivity: 'Recent activity',\n recentlyAdded: 'Recently added',\n reportRotation: 'expired / due for rotation',\n reportWeak: 'weak passwords',\n reportReused: 'credentials reused across entries',\n healthOk: 'vault healthy',\n healthBackup: 'backup',\n backupNow: 'Backup now',\n backupDone: 'Backup created',\n healthStrength: 'strength',\n dueExpired: 'EXPIRED',\n dueExpiring: 'expires in',\n dueNow: 'rotation due',\n showTrash: 'Trash',\n hideTrash: 'Hide trash',\n trashed: 'in trash',\n trashEmpty: 'Trash is empty',\n restore: 'Restore',\n clearTrash: 'Empty trash',\n restoreAll: 'Restore all',\n clearTrashConfirm: 'Permanently delete ALL trashed entries? This cannot be undone.',\n show: 'Show',\n hide: 'Hide',\n allKinds: 'All kinds',\n allTags: 'All tags',\n sortAlpha: 'Sort: A–Z',\n sortRecent: 'Sort: recent',\n highSensitivity: 'HIGH',\n pinned: 'Pinned',\n add: 'Add credential',\n quickAdd: 'Quick add',\n cancel: 'Cancel',\n save: 'Save',\n edit: 'Edit',\n delete: 'Delete',\n deleteConfirm: 'Delete this entry? This cannot be undone.',\n copy: 'Copy',\n copyPassword: 'Copy password',\n copyCode: 'Copy code',\n copied: 'Copied',\n totp: 'Code',\n fieldTitle: 'Title',\n fieldKind: 'Kind',\n fieldUsername: 'Username',\n fieldEmail: 'Email',\n fieldPhone: 'Phone',\n fieldPassword: 'Password',\n fieldHost: 'Host',\n fieldPort: 'Port',\n fieldApiKey: 'API key',\n fieldSecret: 'Secret',\n fieldAccessToken: 'Access token',\n fieldRefreshToken: 'Refresh token',\n fieldOtpSecret: 'OTP secret',\n fieldUrl: 'URL',\n fieldNotes: 'Notes',\n fieldTags: 'Tags',\n fieldIcon: 'Icon (emoji)',\n fieldExpiresAt: 'Expires at',\n fieldRotationDays: 'Rotation (days, 0 = never)',\n fieldSensitivity: 'Sensitivity',\n fieldFavorite: 'Pinned',\n sensitivityNormal: 'normal',\n sensitivityHigh: 'high',\n favoriteHint: 'Show at top',\n rotationClearHint: '0 clears rotation',\n fieldColor: 'Color',\n fieldCustom: 'Custom fields (key=value per line)',\n error: 'Something went wrong.',\n kindLogin: 'Login',\n kindSsh: 'SSH',\n kindApiKey: 'API key',\n kindSecret: 'Secret',\n kindOauth: 'OAuth',\n kindCustom: 'Custom',\n} as const\n\nexport type VaultLocaleKey = keyof typeof en\n\n/** Chinese strings (same keys as English). */\nexport const zh: Record<VaultLocaleKey, string> = {\n nav: '凭据库',\n heading: 'Vault 凭据库',\n intro: '本机加密存储的凭据。',\n searchPlaceholder: '搜索标题、用户名、邮箱、主机…',\n loading: '加载中…',\n empty: '还没有凭据,添加一条开始使用。',\n emptyHint: '提示:你可以在对话中把 API Key 或 token 交给助手保存——开启自动捕获后,它会在你同意时帮你存入本库。批量导入?让助手调用 vault_import_csv 并给出 CSV 路径即可。',\n emptyHintReadonly: '当前为只读模式——只能读取凭据,不能在此添加。将 accessMode 改为 \"readwrite\" 即可启用写入。',\n modeLabel: '访问模式',\n autoCaptureLabel: '自动捕获对话中的凭据',\n modeReadonly: '只读',\n modeAsk: '写入前询问',\n modeAuto: '自动读写',\n modeReadonlyHint: '只读 —— 变更已禁用',\n modeAskHint: '写入前询问 —— 每次增/改/删都会征求你的确认',\n modeAutoHint: '自动读写 —— 无需逐次确认',\n autoCaptureOn: '自动捕获已开启',\n autoCaptureOff: '自动捕获已关闭',\n clearSearch: '清除搜索',\n entryCount: '条目数',\n reportTitle: '健康与轮换',\n recentActivity: '最近活动',\n recentlyAdded: '最近添加',\n reportRotation: '已过期 / 待轮换',\n reportWeak: '弱密码',\n reportReused: '跨条目复用的凭据',\n healthOk: '凭据库健康',\n healthBackup: '备份',\n backupNow: '立即备份',\n backupDone: '备份已创建',\n healthStrength: '强度',\n dueExpired: '已过期',\n dueExpiring: '将于',\n dueNow: '待轮换',\n showTrash: '回收站',\n hideTrash: '隐藏回收站',\n trashed: '已删除',\n trashEmpty: '回收站为空',\n restore: '恢复',\n clearTrash: '清空回收站',\n restoreAll: '全部恢复',\n clearTrashConfirm: '永久删除回收站中全部条目?此操作不可撤销。',\n show: '显示',\n hide: '隐藏',\n allKinds: '全部类型',\n allTags: '全部标签',\n sortAlpha: '排序:A–Z',\n sortRecent: '排序:最近',\n highSensitivity: '高敏',\n pinned: '已置顶',\n add: '新增凭据',\n quickAdd: '快速添加',\n cancel: '取消',\n save: '保存',\n edit: '编辑',\n delete: '删除',\n deleteConfirm: '确定删除该条目?此操作不可撤销。',\n copy: '复制',\n copyPassword: '复制密码',\n copyCode: '复制验证码',\n copied: '已复制',\n totp: '验证码',\n fieldTitle: '标题',\n fieldKind: '类型',\n fieldUsername: '用户名',\n fieldEmail: '邮箱',\n fieldPhone: '手机号',\n fieldPassword: '密码',\n fieldHost: '主机',\n fieldPort: '端口',\n fieldApiKey: 'API 密钥',\n fieldSecret: 'Secret',\n fieldAccessToken: '访问令牌',\n fieldRefreshToken: '刷新令牌',\n fieldOtpSecret: 'TOTP 密钥',\n fieldUrl: 'URL',\n fieldNotes: '备注',\n fieldTags: '标签',\n fieldIcon: '图标(emoji)',\n fieldExpiresAt: '过期时间',\n fieldRotationDays: '轮换周期(天,0=永不)',\n fieldSensitivity: '敏感级别',\n fieldFavorite: '置顶',\n sensitivityNormal: '普通',\n sensitivityHigh: '高敏',\n favoriteHint: '列表置顶显示',\n rotationClearHint: '0 清除轮换',\n fieldColor: '颜色',\n fieldCustom: '自定义字段(每行 key=value)',\n error: '操作失败。',\n kindLogin: '登录',\n kindSsh: 'SSH',\n kindApiKey: 'API 密钥',\n kindSecret: 'Secret',\n kindOauth: 'OAuth',\n kindCustom: '自定义',\n}\n","/**\n * dsh-vault browser half: a Vault settings page managing encrypted\n * credentials — list, search, add, edit, delete, and copy — through the host\n * VaultGateway remote over the /api RPC channel.\n *\n * @module dsh-vault/client\n */\n\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-api-remotes/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport { VaultSection, type VaultSectionInjected } from './VaultSection.tsx'\nimport type { VaultSectionTypes } from './VaultSection.tsx'\nimport { en, zh, type VaultLocaleKey } from './locales.ts'\n\nexport type { VaultSectionInjected, VaultSectionProps } from './VaultSection.tsx'\nexport type { VaultSectionTypes } from './VaultSection.tsx'\nexport type { VaultLocaleKey } from './locales.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Vault settings page copy. */\n 'settings.vault': VaultLocaleKey\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nexport const NS = 'settings.vault'\n\n/** Services required by the Settings registration and the RPC face. */\nexport const inject = ['slots', 'locale', 'connection']\n\n/**\n * Register the Vault settings section once the `settings.section` declaration\n * is on the ledger. The section talks to the host through the connection RPC\n * channel (endpoints `vault/*` served by the host VaultGateway remote).\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-vault: dictionaries')\n\n const t = ctx.locale.bind(NS)\n const connection = ctx.get('connection') as ConnectionHandle\n\n /** Invoke one host vault remote and normalize the RPC envelope. */\n async function invoke<T>(method: string, args: Record<string, unknown> = {}): Promise<T> {\n const result = await connection.rpc.call('/api', `vault/${method}`, { args })\n if (!result.ok) {\n throw new Error(`vault.${method} failed: ${result.error.code}: ${result.error.message}`)\n }\n return result.value as T\n }\n\n const injected = (): VaultSectionInjected => ({\n t,\n config: () => invoke<VaultSectionTypes['config']>('config'),\n setAccessMode: (mode) => invoke<VaultSectionTypes['config']>('setAccessMode', { mode }),\n setAutoCapture: (enabled) => invoke<VaultSectionTypes['config']>('setAutoCapture', { enabled }),\n list: () => invoke<{ entries: VaultSectionTypes['entries'] }>('list').then(r => r.entries),\n search: (query, limit) => invoke<{ entries: VaultSectionTypes['entries'] }>('search', { query, limit: limit ?? 50 }).then(r => r.entries),\n get: (id) => invoke<{ found: boolean; entry?: VaultSectionTypes['fullEntry'] }>('get', { id }),\n add: (patch) => invoke<VaultSectionTypes['summaryEntry']>('add', { patch }),\n update: (id, patch) => invoke<{ found: boolean; entry?: VaultSectionTypes['summaryEntry'] }>('update', { id, patch }),\n remove: (id) => invoke<{ deleted: boolean }>('delete', { id }),\n trash: () => invoke<{ entries: VaultSectionTypes['entries'] }>('trash').then(r => r.entries),\n rotation: () => invoke<{ entries: unknown[] }>('rotation').then(r => r.entries),\n history: () => invoke<{ events: unknown[] }>('history').then(r => r.events),\n stats: () => invoke<Record<string, unknown>>('stats'),\n recent: () => invoke<{ entries: unknown[] }>('recent').then(r => r.entries),\n backupStatus: () => invoke<{ daysSinceBackup: number; backups: number }>('backupStatus'),\n backup: (maxBackups) => invoke<{ path: string; kept: number; pruned: number }>('backup', { maxBackups: maxBackups ?? 10 }),\n health: () => invoke<{ weak: unknown[]; reused: unknown[]; strength: { weak: number; fair: number; strong: number } }>('health'),\n restore: (id) => invoke<{ restored: boolean }>('restore', { id }),\n undeleteAll: () => invoke<{ restored: number }>('undeleteAll'),\n totp: (id) => invoke<{ code: string; label?: string; secondsRemaining: number }>('totp', { id }),\n })\n\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: 'vault',\n order: 30,\n label: () => t('nav'),\n inject: injected,\n }, VaultSection))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HA,MAAM,cAAuE;GAC3E;IAAE,KAAK;IAAS,OAAO;GAAa;GACpC;IAAE,KAAK;IAAQ,OAAO;GAAY;GAClC;IAAE,KAAK;IAAY,OAAO;GAAgB;GAC1C;IAAE,KAAK;IAAS,OAAO;GAAa;GACpC;IAAE,KAAK;IAAS,OAAO;GAAa;GACpC;IAAE,KAAK;IAAY,OAAO;GAAgB;GAC1C;IAAE,KAAK;IAAQ,OAAO;GAAY;GAClC;IAAE,KAAK;IAAQ,OAAO;GAAY;GAClC;IAAE,KAAK;IAAU,OAAO;GAAc;GACtC;IAAE,KAAK;IAAU,OAAO;GAAc;GACtC;IAAE,KAAK;IAAe,OAAO;GAAmB;GAChD;IAAE,KAAK;IAAgB,OAAO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,CAAC,CAAC,MAAK,MAAK,EAAE,OAAO;IAC3F,gBAAgB,OAA+B,UAAU,CAAC,CAAC,MAAK,MAAK,EAAE,OAAO;IAC9E,eAAe,OAA8B,SAAS,CAAC,CAAC,MAAK,MAAK,EAAE,MAAM;IAC1E,aAAa,OAAgC,OAAO;IACpD,cAAc,OAA+B,QAAQ,CAAC,CAAC,MAAK,MAAK,EAAE,OAAO;IAC1E,oBAAoB,OAAqD,cAAc;IACvF,SAAS,eAAe,OAAuD,UAAU,EAAE,YAAY,cAAc,GAAG,CAAC;IACzH,cAAc,OAAyG,QAAQ;IAC/H,UAAU,OAAO,OAA8B,WAAW,EAAE,GAAG,CAAC;IAChE,mBAAmB,OAA6B,aAAa;IAC7D,OAAO,OAAO,OAAmE,QAAQ,EAAE,GAAG,CAAC;GACjG;GAEA,IAAI,MAAM,OAAO,0BAA0B,IAAI,MAAM,SAAS;IAC5D,MAAM;IACN,IAAI;IACJ,OAAO;IACP,aAAa,EAAE,KAAK;IACpB,QAAQ;GACV,GAAG,YAAY,CAAC;EAClB"}
|
package/lib/index.js
CHANGED
|
@@ -53,12 +53,12 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
53
53
|
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
54
54
|
import Schema from '@deepseek-ai/schemastery';
|
|
55
55
|
import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
56
|
-
import { readFile, writeFile, mkdir, readdir } from 'node:fs/promises';
|
|
56
|
+
import { readFile, writeFile, mkdir, readdir, unlink } from 'node:fs/promises';
|
|
57
57
|
import { randomUUID } from 'node:crypto';
|
|
58
58
|
import { dirname, join } from 'node:path';
|
|
59
59
|
import { openVault, defaultVaultPath } from "./store.js";
|
|
60
60
|
import { totp, parseTotpSecret, hotp, base32Decode } from "./totp.js";
|
|
61
|
-
import { generatePassword } from "./password.js";
|
|
61
|
+
import { generatePassword, generatePassphrase } from "./password.js";
|
|
62
62
|
export const name = 'dsh-vault';
|
|
63
63
|
export const inject = ['tools'];
|
|
64
64
|
export const Config = Schema.object({
|
|
@@ -570,9 +570,9 @@ export async function apply(ctx, config) {
|
|
|
570
570
|
}));
|
|
571
571
|
ctx.tools.register(defineTool({
|
|
572
572
|
name: 'vault_generate_password',
|
|
573
|
-
description: 'Generate a cryptographically strong random password
|
|
574
|
-
+ 'Use
|
|
575
|
-
+ 'call vault_add or vault_update to persist it.',
|
|
573
|
+
description: 'Generate a cryptographically strong random password (configurable length/classes) or a '
|
|
574
|
+
+ 'memorable passphrase (passphrase: true, EFF-style word list). Use when a user needs a new password; '
|
|
575
|
+
+ 'the generated value is returned and is not stored automatically — call vault_add or vault_update to persist it.',
|
|
576
576
|
parameters: {
|
|
577
577
|
length: { type: 'integer', description: 'Total length (default 20, min = number of selected classes).' },
|
|
578
578
|
lowercase: { type: 'boolean', description: 'Include lowercase (default true).' },
|
|
@@ -583,6 +583,10 @@ export async function apply(ctx, config) {
|
|
|
583
583
|
group: { type: 'integer', description: 'Insert "-" every N characters (e.g. 3 → vK7-mQ2-zt9).' },
|
|
584
584
|
prefix: { type: 'string', description: 'Fixed prefix prepended to the random core (site requirements).' },
|
|
585
585
|
suffix: { type: 'string', description: 'Fixed suffix appended to the random core (site requirements).' },
|
|
586
|
+
passphrase: { type: 'boolean', description: 'Generate a memorable passphrase instead of a random password (ignores length/classes/group).' },
|
|
587
|
+
words: { type: 'integer', description: 'Number of words for passphrase mode (default 4, 2–12).' },
|
|
588
|
+
separator: { type: 'string', description: 'Separator between passphrase words (default "-").' },
|
|
589
|
+
wordDigits: { type: 'boolean', description: 'Append two random digits in passphrase mode (default true).' },
|
|
586
590
|
},
|
|
587
591
|
output: {
|
|
588
592
|
schema: {
|
|
@@ -596,6 +600,14 @@ export async function apply(ctx, config) {
|
|
|
596
600
|
render: (_args, value) => [{ type: 'text', text: value.password }],
|
|
597
601
|
},
|
|
598
602
|
async execute(args) {
|
|
603
|
+
if (args.passphrase === true) {
|
|
604
|
+
const password = generatePassphrase({
|
|
605
|
+
...(args.words !== undefined ? { words: args.words } : {}),
|
|
606
|
+
...(args.separator !== undefined ? { separator: args.separator } : {}),
|
|
607
|
+
...(args.wordDigits !== undefined ? { wordDigits: args.wordDigits } : {}),
|
|
608
|
+
});
|
|
609
|
+
return { password, length: password.length };
|
|
610
|
+
}
|
|
599
611
|
const password = generatePassword({
|
|
600
612
|
...(args.length !== undefined ? { length: args.length } : {}),
|
|
601
613
|
...(args.lowercase !== undefined ? { lowercase: args.lowercase } : {}),
|
|
@@ -746,8 +758,7 @@ export async function apply(ctx, config) {
|
|
|
746
758
|
async execute(args) {
|
|
747
759
|
assertWritable('vault_expiry');
|
|
748
760
|
const s = await guardStore();
|
|
749
|
-
const
|
|
750
|
-
const updated = await s.update(args.id, patch);
|
|
761
|
+
const updated = await s.update(args.id, { expiresAt: args.expiresAt });
|
|
751
762
|
return { updated: updated !== undefined };
|
|
752
763
|
},
|
|
753
764
|
}));
|
|
@@ -887,7 +898,7 @@ export async function apply(ctx, config) {
|
|
|
887
898
|
description: 'Vault overview: total entries, counts by kind, entries with TOTP, high-sensitivity '
|
|
888
899
|
+ 'entries, and expired credentials. No secrets returned. Useful for a quick health glance.',
|
|
889
900
|
parameters: {},
|
|
890
|
-
output: { schema: { type: 'object', additionalProperties: false, properties: { total: { type: 'integer', required: true }, byKind: { type: 'json', required: true }, byTag: { type: 'json', required: true }, withTotp: { type: 'integer', required: true }, withPrivateKey: { type: 'integer', required: true }, highSensitivity: { type: 'integer', required: true }, expired: { type: 'integer', required: true }, recent7d: { type: 'integer', required: true } } }, render: (_a, v) => [{ type: 'text', text: `vault: ${v.total} entries (${JSON.stringify(v.byKind)})` }] },
|
|
901
|
+
output: { schema: { type: 'object', additionalProperties: false, properties: { total: { type: 'integer', required: true }, byKind: { type: 'json', required: true }, byTag: { type: 'json', required: true }, withTotp: { type: 'integer', required: true }, withPrivateKey: { type: 'integer', required: true }, highSensitivity: { type: 'integer', required: true }, expired: { type: 'integer', required: true }, recent7d: { type: 'integer', required: true }, trashCount: { type: 'integer', required: true } } }, render: (_a, v) => [{ type: 'text', text: `vault: ${v.total} entries, ${v.trashCount} trashed (${JSON.stringify(v.byKind)})` }] },
|
|
891
902
|
async execute() {
|
|
892
903
|
const s = await guardStore();
|
|
893
904
|
return s.stats();
|
|
@@ -1168,6 +1179,8 @@ export async function apply(ctx, config) {
|
|
|
1168
1179
|
kind: { type: 'string', enum: ['login', 'ssh', 'api-key', 'secret', 'oauth', 'custom'], description: 'Entry kind (default login).' },
|
|
1169
1180
|
secret: { type: 'string', description: 'The secret value: stored into apiKey for api-key, password for login, secret otherwise.' },
|
|
1170
1181
|
username: { type: 'string', description: 'Optional username.' },
|
|
1182
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Searchable tags.' },
|
|
1183
|
+
notes: { type: 'string', description: 'Optional free-form notes.' },
|
|
1171
1184
|
},
|
|
1172
1185
|
output: { schema: { type: 'object', additionalProperties: false, properties: { id: { type: 'string', required: true }, title: { type: 'string', required: true } } }, render: (_a, v) => [{ type: 'text', text: `added ${v.title} (id: ${v.id})` }] },
|
|
1173
1186
|
async execute(args) {
|
|
@@ -1183,6 +1196,8 @@ export async function apply(ctx, config) {
|
|
|
1183
1196
|
title: args.title.trim(),
|
|
1184
1197
|
kind,
|
|
1185
1198
|
...(args.username !== undefined ? { username: args.username } : {}),
|
|
1199
|
+
...(args.tags !== undefined ? { tags: normalizeTags(args.tags) } : {}),
|
|
1200
|
+
...(args.notes !== undefined ? { notes: args.notes } : {}),
|
|
1186
1201
|
...(kind === 'api-key' ? { apiKey: args.secret } : kind === 'login' ? { password: args.secret } : { secret: args.secret }),
|
|
1187
1202
|
});
|
|
1188
1203
|
emitAudit('write', 'vault_quick_add', entry.id, entry.title);
|
|
@@ -1193,16 +1208,18 @@ export async function apply(ctx, config) {
|
|
|
1193
1208
|
ctx.tools.register(defineTool({
|
|
1194
1209
|
name: 'vault_merge',
|
|
1195
1210
|
description: 'Merge one entry INTO another (Bitwarden-style duplicate cleanup): non-empty fields of '
|
|
1196
|
-
+ 'the source fill gaps in the target, then the source is permanently removed
|
|
1211
|
+
+ 'the source fill gaps in the target, then the source is permanently removed (unless keepSource). '
|
|
1212
|
+
+ 'Returns the merged summary.',
|
|
1197
1213
|
parameters: {
|
|
1198
1214
|
fromId: { type: 'string', required: true, description: 'Source entry id (merged into the target, then deleted).' },
|
|
1199
1215
|
toId: { type: 'string', required: true, description: 'Target entry id (kept, gaps filled).' },
|
|
1216
|
+
keepSource: { type: 'boolean', description: 'Keep the source entry after merging (default false = delete it).' },
|
|
1200
1217
|
},
|
|
1201
1218
|
output: { schema: { type: 'object', additionalProperties: false, properties: { merged: { type: 'boolean', required: true }, entry: { type: 'json' } } }, render: (_a, v) => [{ type: 'text', text: v.merged ? 'entries merged' : 'merge failed (one/both not found or in trash)' }] },
|
|
1202
1219
|
async execute(args) {
|
|
1203
1220
|
assertWritable('vault_merge');
|
|
1204
1221
|
const s = await guardStore();
|
|
1205
|
-
const merged = await s.merge(args.fromId, args.toId);
|
|
1222
|
+
const merged = await s.merge(args.fromId, args.toId, { keepSource: args.keepSource === true });
|
|
1206
1223
|
return merged === undefined ? { merged: false } : { merged: true, entry: toSummaryJson(merged) };
|
|
1207
1224
|
},
|
|
1208
1225
|
}));
|
|
@@ -1781,15 +1798,19 @@ export async function apply(ctx, config) {
|
|
|
1781
1798
|
ctx.tools.register(defineTool({
|
|
1782
1799
|
name: 'vault_rotation',
|
|
1783
1800
|
description: 'Report credentials that are expired, due for rotation (rotationDays elapsed), '
|
|
1784
|
-
+ 'or expiring
|
|
1785
|
-
parameters: {},
|
|
1801
|
+
+ 'or expiring soon. Returns summaries with a due state — never secrets.',
|
|
1802
|
+
parameters: { soonWindowDays: { type: 'integer', description: 'How many days ahead counts as "expiring soon" (default 7, 1–90).' } },
|
|
1786
1803
|
output: {
|
|
1787
1804
|
schema: { type: 'object', additionalProperties: false, properties: { entries: { type: 'array', required: true, items: { type: 'json' } } } },
|
|
1788
1805
|
render: (_a, v) => [{ type: 'text', text: v.entries.length === 0 ? 'no rotation items' : JSON.stringify(v.entries) }],
|
|
1789
1806
|
},
|
|
1790
|
-
async execute() {
|
|
1807
|
+
async execute(args) {
|
|
1791
1808
|
const s = await guardStore();
|
|
1792
|
-
|
|
1809
|
+
const window = args.soonWindowDays === undefined ? 7 : args.soonWindowDays;
|
|
1810
|
+
if (!Number.isInteger(window) || window < 1 || window > 90) {
|
|
1811
|
+
throw new Error('vault_rotation: soonWindowDays must be an integer 1–90');
|
|
1812
|
+
}
|
|
1813
|
+
return { entries: s.rotationReport(Date.now(), window) };
|
|
1793
1814
|
},
|
|
1794
1815
|
}));
|
|
1795
1816
|
// ── vault_health: weak / reused credential scan ────────────────────────────
|
|
@@ -2008,18 +2029,44 @@ export async function apply(ctx, config) {
|
|
|
2008
2029
|
ctx.tools.register(defineTool({
|
|
2009
2030
|
name: 'vault_backup',
|
|
2010
2031
|
description: 'Create a timestamped backup of the vault file (a copy of the on-disk encrypted '
|
|
2011
|
-
+ 'document, not a plaintext export).
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2032
|
+
+ 'document, not a plaintext export). Old backups beyond maxBackups (default 10) are pruned '
|
|
2033
|
+
+ 'automatically (newest kept). Returns the backup path and retention stats.',
|
|
2034
|
+
parameters: { maxBackups: { type: 'integer', description: 'Keep at most this many backups (default 10, min 1).' } },
|
|
2035
|
+
output: { schema: { type: 'object', additionalProperties: false, properties: { path: { type: 'string', required: true }, kept: { type: 'integer', required: true }, pruned: { type: 'integer', required: true } } }, render: (_a, v) => [{ type: 'text', text: `backup written to ${v.path} (kept ${v.kept}, pruned ${v.pruned})` }] },
|
|
2036
|
+
async execute(args) {
|
|
2015
2037
|
const s = await guardStore();
|
|
2016
2038
|
const source = resolveVaultPath(config);
|
|
2017
|
-
const
|
|
2039
|
+
const dir = dirname(source);
|
|
2040
|
+
const maxBackups = args.maxBackups === undefined ? 10 : args.maxBackups;
|
|
2041
|
+
if (!Number.isInteger(maxBackups) || maxBackups < 1 || maxBackups > 100) {
|
|
2042
|
+
throw new Error('vault_backup: maxBackups must be an integer 1–100');
|
|
2043
|
+
}
|
|
2044
|
+
const backup = join(dir, `vault-backup-${Date.now()}.json`);
|
|
2018
2045
|
const raw = await readFile(source, 'utf8');
|
|
2019
|
-
await mkdir(
|
|
2046
|
+
await mkdir(dir, { recursive: true, mode: 0o700 });
|
|
2020
2047
|
await writeFile(backup, raw, { mode: 0o600 });
|
|
2048
|
+
// Retention: keep the newest maxBackups vault-backup-*.json files.
|
|
2049
|
+
let backups = [];
|
|
2050
|
+
try {
|
|
2051
|
+
const names = await readdir(dir);
|
|
2052
|
+
backups = names.filter(n => /^vault-backup-\d+\.json$/.test(n))
|
|
2053
|
+
.map(n => join(dir, n))
|
|
2054
|
+
.sort((a, b) => b.localeCompare(a)); // newest first (timestamp in name)
|
|
2055
|
+
}
|
|
2056
|
+
catch {
|
|
2057
|
+
backups = [];
|
|
2058
|
+
}
|
|
2059
|
+
backups = backups.filter(n => n !== backup);
|
|
2060
|
+
let pruned = 0;
|
|
2061
|
+
for (const stale of backups.slice(maxBackups - 1)) {
|
|
2062
|
+
try {
|
|
2063
|
+
await unlink(stale);
|
|
2064
|
+
pruned++;
|
|
2065
|
+
}
|
|
2066
|
+
catch { /* best-effort */ }
|
|
2067
|
+
}
|
|
2021
2068
|
void s;
|
|
2022
|
-
return { path: backup };
|
|
2069
|
+
return { path: backup, kept: Math.min(backups.length + 1, maxBackups), pruned };
|
|
2023
2070
|
},
|
|
2024
2071
|
}));
|
|
2025
2072
|
// ── vault_import_csv: bulk import from a CSV file ───────────────────────────
|
|
@@ -2215,6 +2262,7 @@ let VaultGateway = (() => {
|
|
|
2215
2262
|
let _trash_decorators;
|
|
2216
2263
|
let _undeleteAll_decorators;
|
|
2217
2264
|
let _restore_decorators;
|
|
2265
|
+
let _backup_decorators;
|
|
2218
2266
|
let _backupStatus_decorators;
|
|
2219
2267
|
let _stats_decorators;
|
|
2220
2268
|
let _recent_decorators;
|
|
@@ -2237,6 +2285,7 @@ let VaultGateway = (() => {
|
|
|
2237
2285
|
_trash_decorators = [Remote('trash')];
|
|
2238
2286
|
_undeleteAll_decorators = [Remote('undeleteAll')];
|
|
2239
2287
|
_restore_decorators = [Remote('restore')];
|
|
2288
|
+
_backup_decorators = [Remote('backup')];
|
|
2240
2289
|
_backupStatus_decorators = [Remote('backupStatus')];
|
|
2241
2290
|
_stats_decorators = [Remote('stats')];
|
|
2242
2291
|
_recent_decorators = [Remote('recent')];
|
|
@@ -2256,6 +2305,7 @@ let VaultGateway = (() => {
|
|
|
2256
2305
|
__esDecorate(this, null, _trash_decorators, { kind: "method", name: "trash", static: false, private: false, access: { has: obj => "trash" in obj, get: obj => obj.trash }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
2257
2306
|
__esDecorate(this, null, _undeleteAll_decorators, { kind: "method", name: "undeleteAll", static: false, private: false, access: { has: obj => "undeleteAll" in obj, get: obj => obj.undeleteAll }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
2258
2307
|
__esDecorate(this, null, _restore_decorators, { kind: "method", name: "restore", static: false, private: false, access: { has: obj => "restore" in obj, get: obj => obj.restore }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
2308
|
+
__esDecorate(this, null, _backup_decorators, { kind: "method", name: "backup", static: false, private: false, access: { has: obj => "backup" in obj, get: obj => obj.backup }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
2259
2309
|
__esDecorate(this, null, _backupStatus_decorators, { kind: "method", name: "backupStatus", static: false, private: false, access: { has: obj => "backupStatus" in obj, get: obj => obj.backupStatus }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
2260
2310
|
__esDecorate(this, null, _stats_decorators, { kind: "method", name: "stats", static: false, private: false, access: { has: obj => "stats" in obj, get: obj => obj.stats }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
2261
2311
|
__esDecorate(this, null, _recent_decorators, { kind: "method", name: "recent", static: false, private: false, access: { has: obj => "recent" in obj, get: obj => obj.recent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -2351,6 +2401,30 @@ let VaultGateway = (() => {
|
|
|
2351
2401
|
return { restored: await store.restore(id) };
|
|
2352
2402
|
}
|
|
2353
2403
|
/** Days since last backup + backup count (no secrets). */
|
|
2404
|
+
async backup(maxBackups = 10) {
|
|
2405
|
+
const dir = dirname(this.vaultPath ?? defaultVaultPath(this.vaultName));
|
|
2406
|
+
const source = this.vaultPath ?? defaultVaultPath(this.vaultName);
|
|
2407
|
+
const backup = join(dir, `vault-backup-${Date.now()}.json`);
|
|
2408
|
+
const raw = await readFile(source, 'utf8');
|
|
2409
|
+
await mkdir(dir, { recursive: true, mode: 0o700 });
|
|
2410
|
+
await writeFile(backup, raw, { mode: 0o600 });
|
|
2411
|
+
let total = 1;
|
|
2412
|
+
let pruned = 0;
|
|
2413
|
+
try {
|
|
2414
|
+
const names = (await readdir(dir)).filter(n => /^vault-backup-\d+\.json$/.test(n))
|
|
2415
|
+
.map(n => join(dir, n)).sort((a, b) => b.localeCompare(a));
|
|
2416
|
+
total = names.length;
|
|
2417
|
+
for (const stale of names.filter(n => n !== backup).slice(maxBackups - 1)) {
|
|
2418
|
+
try {
|
|
2419
|
+
await unlink(stale);
|
|
2420
|
+
pruned++;
|
|
2421
|
+
}
|
|
2422
|
+
catch { /* best-effort */ }
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
catch { /* no dir yet */ }
|
|
2426
|
+
return { path: backup, kept: Math.max(1, Math.min(total, maxBackups)), pruned };
|
|
2427
|
+
}
|
|
2354
2428
|
async backupStatus() {
|
|
2355
2429
|
const dir = dirname(this.vaultPath ?? defaultVaultPath(this.vaultName));
|
|
2356
2430
|
const backups = [];
|
|
@@ -2383,9 +2457,10 @@ let VaultGateway = (() => {
|
|
|
2383
2457
|
return { events: store.getHistory().slice(0, 20) };
|
|
2384
2458
|
}
|
|
2385
2459
|
/** Rotation/expiry report (no secrets). */
|
|
2386
|
-
async rotation() {
|
|
2460
|
+
async rotation(soonWindowDays) {
|
|
2387
2461
|
const store = await this.ensureStore();
|
|
2388
|
-
|
|
2462
|
+
const window = soonWindowDays === undefined ? 7 : soonWindowDays;
|
|
2463
|
+
return { entries: store.rotationReport(Date.now(), window) };
|
|
2389
2464
|
}
|
|
2390
2465
|
/** Health scan findings (no secrets). */
|
|
2391
2466
|
async health() {
|
package/lib/password.js
CHANGED
|
@@ -86,3 +86,46 @@ export function generatePassword(options = {}) {
|
|
|
86
86
|
}
|
|
87
87
|
return password;
|
|
88
88
|
}
|
|
89
|
+
/** Small EFF-style word list for passphrases (128 common, memorable words). */
|
|
90
|
+
const PASSPHRASE_WORDS = [
|
|
91
|
+
'abacus', 'acorn', 'alpine', 'anchor', 'apricot', 'archer', 'aspen', 'autumn',
|
|
92
|
+
'bamboo', 'banyan', 'beacon', 'birch', 'biscuit', 'blossom', 'bravo', 'breeze',
|
|
93
|
+
'cactus', 'canyon', 'cascade', 'cedar', 'charm', 'cherry', 'cinder', 'cobalt',
|
|
94
|
+
'coral', 'cricket', 'crimson', 'crystal', 'cypress', 'dahlia', 'dandelion', 'delta',
|
|
95
|
+
'denim', 'diamond', 'dolphin', 'drift', 'eagle', 'ember', 'falcon', 'fennel',
|
|
96
|
+
'ferret', 'fjord', 'flint', 'foxtrot', 'garden', 'garnet', 'gecko', 'ginkgo',
|
|
97
|
+
'glacier', 'granite', 'gull', 'harbor', 'hazel', 'heron', 'honey', 'horizon',
|
|
98
|
+
'iris', 'island', 'ivory', 'jaguar', 'jasmine', 'juniper', 'kayak', 'kestrel',
|
|
99
|
+
'lagoon', 'larch', 'lilac', 'lotus', 'magpie', 'maple', 'marble', 'meadow',
|
|
100
|
+
'mentor', 'mosaic', 'nectar', 'nimbus', 'oak', 'obsidian', 'olive', 'onyx',
|
|
101
|
+
'orchid', 'otter', 'panda', 'papaya', 'pebble', 'pepper', 'phoenix', 'pine',
|
|
102
|
+
'plum', 'quartz', 'quill', 'raven', 'reed', 'river', 'robin', 'ruby',
|
|
103
|
+
'saffron', 'sage', 'salamander', 'sand', 'sapphire', 'sequoia', 'shale', 'silver',
|
|
104
|
+
'snow', 'sparrow', 'spruce', 'starling', 'stone', 'sunset', 'tiger', 'topaz',
|
|
105
|
+
'tulip', 'umber', 'velvet', 'violet', 'walnut', 'willow', 'winter', 'xenon',
|
|
106
|
+
'yarrow', 'zephyr', 'zinnia',
|
|
107
|
+
];
|
|
108
|
+
/**
|
|
109
|
+
* Generate a memorable passphrase ("correct-horse-battery-staple" style) from
|
|
110
|
+
* a 128-word list. Optionally appends two random digits for sites that require
|
|
111
|
+
* a number. Zero dependencies; entropy comes from `node:crypto`.
|
|
112
|
+
* @throws when `words` is not an integer in 2–12, or separator is empty.
|
|
113
|
+
*/
|
|
114
|
+
export function generatePassphrase(options = {}) {
|
|
115
|
+
const words = options.words ?? 4;
|
|
116
|
+
const separator = options.separator ?? '-';
|
|
117
|
+
const withDigits = options.wordDigits ?? true;
|
|
118
|
+
if (!Number.isInteger(words) || words < 2 || words > 12) {
|
|
119
|
+
throw new Error('passphrase: words must be an integer 2–12');
|
|
120
|
+
}
|
|
121
|
+
if (separator.length === 0)
|
|
122
|
+
throw new Error('passphrase: separator must not be empty');
|
|
123
|
+
const parts = [];
|
|
124
|
+
for (let i = 0; i < words; i++) {
|
|
125
|
+
parts.push(PASSPHRASE_WORDS[randomInt(PASSPHRASE_WORDS.length)]);
|
|
126
|
+
}
|
|
127
|
+
let phrase = parts.join(separator);
|
|
128
|
+
if (withDigits)
|
|
129
|
+
phrase += separator + String(randomInt(10)) + String(randomInt(10));
|
|
130
|
+
return phrase;
|
|
131
|
+
}
|
package/lib/store.js
CHANGED
|
@@ -279,12 +279,18 @@ export class VaultStore {
|
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
this.entries.set(id, updated);
|
|
282
|
-
// rotationDays: 0 means "never rotate"
|
|
283
|
-
// of keeping a zero
|
|
282
|
+
// rotationDays: 0 means "never rotate"; expiresAt: 0 means "no expiry".
|
|
283
|
+
// Clear the field entirely instead of keeping a zero value that would
|
|
284
|
+
// report due/expired forever.
|
|
285
|
+
const record2 = updated;
|
|
284
286
|
if ('rotationDays' in patch && (patch.rotationDays ?? 0) === 0) {
|
|
285
|
-
delete
|
|
286
|
-
this.entries.set(id, updated);
|
|
287
|
+
delete record2.rotationDays;
|
|
287
288
|
}
|
|
289
|
+
if ('expiresAt' in patch && (patch.expiresAt ?? 0) === 0) {
|
|
290
|
+
delete record2.expiresAt;
|
|
291
|
+
}
|
|
292
|
+
// `updated` is the same object stored in the map, so the deletes above
|
|
293
|
+
// already took effect in place.
|
|
288
294
|
this.recordHistory('update', id, updated.title);
|
|
289
295
|
await this.persist();
|
|
290
296
|
return updated;
|
|
@@ -332,7 +338,7 @@ export class VaultStore {
|
|
|
332
338
|
* their last update, or whose `expiresAt` is near/past. Returns only
|
|
333
339
|
* summaries plus the computed due state (no secrets).
|
|
334
340
|
*/
|
|
335
|
-
rotationReport(now = Date.now()) {
|
|
341
|
+
rotationReport(now = Date.now(), soonWindowDays = 7) {
|
|
336
342
|
const report = [];
|
|
337
343
|
for (const entry of this.list()) {
|
|
338
344
|
const base = entry.updatedAt ?? entry.createdAt;
|
|
@@ -351,13 +357,13 @@ export class VaultStore {
|
|
|
351
357
|
}
|
|
352
358
|
else if (expiresAt !== undefined) {
|
|
353
359
|
daysLeft = Math.ceil((expiresAt - now) / 86_400_000);
|
|
354
|
-
if (daysLeft <=
|
|
360
|
+
if (daysLeft <= soonWindowDays) {
|
|
355
361
|
due = 'soon';
|
|
356
362
|
}
|
|
357
363
|
}
|
|
358
364
|
else if (rotationAt !== undefined) {
|
|
359
365
|
daysLeft = Math.ceil((rotationAt - now) / 86_400_000);
|
|
360
|
-
if (daysLeft <=
|
|
366
|
+
if (daysLeft <= soonWindowDays) {
|
|
361
367
|
due = 'soon';
|
|
362
368
|
}
|
|
363
369
|
}
|
|
@@ -421,11 +427,11 @@ export class VaultStore {
|
|
|
421
427
|
if (entry.createdAt >= weekAgo)
|
|
422
428
|
recent7d++;
|
|
423
429
|
}
|
|
424
|
-
return { total: this.list().length, byKind, byTag, withTotp, withPrivateKey, highSensitivity, expired, recent7d };
|
|
430
|
+
return { total: this.list().length, byKind, byTag, withTotp, withPrivateKey, highSensitivity, expired, recent7d, trashCount: this.listTrash().length };
|
|
425
431
|
}
|
|
426
432
|
/** Merge `fromId` into `toId`: non-empty fields of `from` fill gaps in `to`,
|
|
427
433
|
* then `from` is purged. Returns the merged entry or undefined. */
|
|
428
|
-
async merge(fromId, toId) {
|
|
434
|
+
async merge(fromId, toId, options = {}) {
|
|
429
435
|
const from = this.entries.get(fromId);
|
|
430
436
|
const to = this.entries.get(toId);
|
|
431
437
|
if (!from || !to || from.deletedAt !== undefined || to.deletedAt !== undefined)
|
|
@@ -441,7 +447,9 @@ export class VaultStore {
|
|
|
441
447
|
}
|
|
442
448
|
merged.updatedAt = Date.now();
|
|
443
449
|
this.entries.set(toId, merged);
|
|
444
|
-
|
|
450
|
+
if (options.keepSource !== true) {
|
|
451
|
+
this.entries.delete(fromId);
|
|
452
|
+
}
|
|
445
453
|
this.recordHistory('merge', toId, to.title);
|
|
446
454
|
await this.persist();
|
|
447
455
|
return merged;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-vault",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "Encrypted credential vault for DeepSeek Harness: store and retrieve usernames, emails, phone numbers, passwords, TOTP secrets, SSH/API-key/OAuth developer credentials through model tools and a Settings UI page.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|