dsh-vault 1.6.0-rc.9 → 1.6.0
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 +1 -0
- package/README.md +1 -0
- package/lib/client.js +67 -67
- package/lib/index.js +54 -0
- package/package.json +1 -1
package/README-zh.md
CHANGED
|
@@ -58,6 +58,7 @@ dsh-vault 是一个面向 DeepSeek Harness 的安全加密插件:把你在使
|
|
|
58
58
|
| `vault_rekey` | 原地升级 scrypt KDF 参数并重加密 |
|
|
59
59
|
| `vault_backup` | 带时间戳的加密备份,支持保留策略:超过 `maxBackups`(默认 10)的旧备份自动清理 |
|
|
60
60
|
| `vault_import_csv` | 从 CSV 批量导入凭据(自定义列变为 fields;`overwrite: true` 合并字段到已有条目,不再产生重复) |
|
|
61
|
+
| `vault_bulk_delete` | 按 query/kind/tag 或显式 ids 批量软删除条目;需 `confirm: true`(默认仅试运行);回收站可恢复 |
|
|
61
62
|
| `vault_apply_tags` | 按查询批量增/删/替换条目标签(支持 dry-run,不含密钥) |
|
|
62
63
|
| `vault_totp_uri` | 为存储的或裸 TOTP 密钥生成 otpauth:// 配置 URI |
|
|
63
64
|
| `vault_switch` / `vault_list` | 按名称切换当前保险库 / 列出可用保险库 |
|
package/README.md
CHANGED
|
@@ -60,6 +60,7 @@ Each record has a `title`, an optional `kind`, and any combination of fields:
|
|
|
60
60
|
| `vault_rekey` | Upgrade the vault to fresh scrypt KDF parameters in place |
|
|
61
61
|
| `vault_backup` | Timestamped encrypted backup with retention; optional `note` |
|
|
62
62
|
| `vault_import_csv` | Bulk-import credentials from a CSV file (custom columns become fields; `overwrite: true` merges fields into existing entries instead of duplicating) |
|
|
63
|
+
| `vault_bulk_delete` | Soft-delete entries matching a query/kind/tag or explicit ids; `confirm: true` required (dry-run by default); trashed entries are restorable |
|
|
63
64
|
| `vault_apply_tags` | Bulk add/remove/replace tags on every entry matching a query (dry-run supported, no secrets) |
|
|
64
65
|
| `vault_totp_uri` | Build an otpauth:// provisioning URI for a stored or bare TOTP secret |
|
|
65
66
|
| `vault_switch` / `vault_list` | Switch the active vault by name / list available vaults |
|
package/lib/client.js
CHANGED
|
@@ -17,89 +17,89 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
document.head.appendChild(tag);
|
|
18
18
|
}
|
|
19
19
|
var VaultSection_module_css_default = {
|
|
20
|
+
"rowExpired": "t_j5va_rowExpired",
|
|
20
21
|
"toolbar": "t_j5va_toolbar",
|
|
21
|
-
"scoreRing": "t_j5va_scoreRing",
|
|
22
|
-
"genHist": "t_j5va_genHist",
|
|
23
|
-
"genOpts": "t_j5va_genOpts",
|
|
24
|
-
"kindFilter": "t_j5va_kindFilter",
|
|
25
|
-
"clearButton": "t_j5va_clearButton",
|
|
26
|
-
"addButton": "t_j5va_addButton",
|
|
27
22
|
"status": "t_j5va_status",
|
|
28
|
-
"reportBox": "t_j5va_reportBox",
|
|
29
|
-
"policyBar": "t_j5va_policyBar",
|
|
30
|
-
"tab": "t_j5va_tab",
|
|
31
|
-
"saveButton": "t_j5va_saveButton",
|
|
32
|
-
"trashButton": "t_j5va_trashButton",
|
|
33
|
-
"error": "t_j5va_error",
|
|
34
|
-
"genOptRow": "t_j5va_genOptRow",
|
|
35
|
-
"rowExpired": "t_j5va_rowExpired",
|
|
36
|
-
"reportTitle": "t_j5va_reportTitle",
|
|
37
|
-
"identity": "t_j5va_identity",
|
|
38
|
-
"rowMain": "t_j5va_rowMain",
|
|
39
|
-
"dueBadge": "t_j5va_dueBadge",
|
|
40
|
-
"dupNames": "t_j5va_dupNames",
|
|
41
|
-
"resultCount": "t_j5va_resultCount",
|
|
42
|
-
"empty": "t_j5va_empty",
|
|
43
|
-
"pinStar": "t_j5va_pinStar",
|
|
44
|
-
"kindChip": "t_j5va_kindChip",
|
|
45
|
-
"badgeWarn": "t_j5va_badgeWarn",
|
|
46
|
-
"kindIcon": "t_j5va_kindIcon",
|
|
47
|
-
"highBadge": "t_j5va_highBadge",
|
|
48
|
-
"rowDue": "t_j5va_rowDue",
|
|
49
|
-
"pwMeter": "t_j5va_pwMeter",
|
|
50
|
-
"editorBody": "t_j5va_editorBody",
|
|
51
23
|
"badge": "t_j5va_badge",
|
|
52
|
-
"backupButton": "t_j5va_backupButton",
|
|
53
24
|
"detailItem": "t_j5va_detailItem",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"totpRing": "t_j5va_totpRing",
|
|
57
|
-
"field": "t_j5va_field",
|
|
58
|
-
"deleteButton": "t_j5va_deleteButton",
|
|
59
|
-
"badgeOk": "t_j5va_badgeOk",
|
|
60
|
-
"emptyBox": "t_j5va_emptyBox",
|
|
61
|
-
"lockedBanner": "t_j5va_lockedBanner",
|
|
62
|
-
"emptyHint": "t_j5va_emptyHint",
|
|
63
|
-
"detailBox": "t_j5va_detailBox",
|
|
64
|
-
"srOnly": "t_j5va_srOnly",
|
|
65
|
-
"pwWeak": "t_j5va_pwWeak",
|
|
66
|
-
"lockedTag": "t_j5va_lockedTag",
|
|
25
|
+
"pwFair": "t_j5va_pwFair",
|
|
26
|
+
"pwStrong": "t_j5va_pwStrong",
|
|
67
27
|
"copied": "t_j5va_copied",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
28
|
+
"editorBody": "t_j5va_editorBody",
|
|
29
|
+
"addButton": "t_j5va_addButton",
|
|
70
30
|
"modeAuto": "t_j5va_modeAuto",
|
|
71
|
-
"
|
|
31
|
+
"scoreRing": "t_j5va_scoreRing",
|
|
72
32
|
"tabs": "t_j5va_tabs",
|
|
33
|
+
"reportLine": "t_j5va_reportLine",
|
|
34
|
+
"secretField": "t_j5va_secretField",
|
|
35
|
+
"badgeDanger": "t_j5va_badgeDanger",
|
|
36
|
+
"backupButton": "t_j5va_backupButton",
|
|
37
|
+
"modeReadonly": "t_j5va_modeReadonly",
|
|
73
38
|
"uriCode": "t_j5va_uriCode",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"tabActive": "t_j5va_tabActive",
|
|
77
|
-
"auditRow": "t_j5va_auditRow",
|
|
39
|
+
"badgeOk": "t_j5va_badgeOk",
|
|
40
|
+
"searchBox": "t_j5va_searchBox",
|
|
78
41
|
"row": "t_j5va_row",
|
|
42
|
+
"dupNames": "t_j5va_dupNames",
|
|
43
|
+
"reportTitle": "t_j5va_reportTitle",
|
|
44
|
+
"highBadge": "t_j5va_highBadge",
|
|
45
|
+
"tabActive": "t_j5va_tabActive",
|
|
46
|
+
"error": "t_j5va_error",
|
|
47
|
+
"rowActions": "t_j5va_rowActions",
|
|
48
|
+
"pwBar": "t_j5va_pwBar",
|
|
49
|
+
"emptyBox": "t_j5va_emptyBox",
|
|
50
|
+
"rowMain": "t_j5va_rowMain",
|
|
51
|
+
"empty": "t_j5va_empty",
|
|
52
|
+
"lockedTag": "t_j5va_lockedTag",
|
|
53
|
+
"totp": "t_j5va_totp",
|
|
54
|
+
"modeAsk": "t_j5va_modeAsk",
|
|
55
|
+
"healthBar": "t_j5va_healthBar",
|
|
56
|
+
"kindIcon": "t_j5va_kindIcon",
|
|
57
|
+
"genHist": "t_j5va_genHist",
|
|
58
|
+
"section": "t_j5va_section",
|
|
59
|
+
"totpRing": "t_j5va_totpRing",
|
|
79
60
|
"dangerButton": "t_j5va_dangerButton",
|
|
80
|
-
"
|
|
61
|
+
"reportSub": "t_j5va_reportSub",
|
|
62
|
+
"dupGroup": "t_j5va_dupGroup",
|
|
63
|
+
"genOptRow": "t_j5va_genOptRow",
|
|
64
|
+
"editor": "t_j5va_editor",
|
|
65
|
+
"auditIssues": "t_j5va_auditIssues",
|
|
66
|
+
"pwMeter": "t_j5va_pwMeter",
|
|
67
|
+
"srOnly": "t_j5va_srOnly",
|
|
68
|
+
"genOpts": "t_j5va_genOpts",
|
|
69
|
+
"sortButton": "t_j5va_sortButton",
|
|
70
|
+
"emptyHint": "t_j5va_emptyHint",
|
|
71
|
+
"trashButton": "t_j5va_trashButton",
|
|
72
|
+
"tab": "t_j5va_tab",
|
|
73
|
+
"rowDue": "t_j5va_rowDue",
|
|
74
|
+
"auditRow": "t_j5va_auditRow",
|
|
75
|
+
"clearButton": "t_j5va_clearButton",
|
|
76
|
+
"resultCount": "t_j5va_resultCount",
|
|
77
|
+
"lockedBanner": "t_j5va_lockedBanner",
|
|
78
|
+
"field": "t_j5va_field",
|
|
81
79
|
"policyField": "t_j5va_policyField",
|
|
82
|
-
"
|
|
80
|
+
"reportBox": "t_j5va_reportBox",
|
|
83
81
|
"editorActions": "t_j5va_editorActions",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
82
|
+
"dueBadge": "t_j5va_dueBadge",
|
|
83
|
+
"footer": "t_j5va_footer",
|
|
86
84
|
"checkField": "t_j5va_checkField",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"modeReadonly": "t_j5va_modeReadonly",
|
|
90
|
-
"reportSub": "t_j5va_reportSub",
|
|
85
|
+
"detailBox": "t_j5va_detailBox",
|
|
86
|
+
"dupMerge": "t_j5va_dupMerge",
|
|
91
87
|
"pwLabel": "t_j5va_pwLabel",
|
|
92
|
-
"
|
|
93
|
-
"
|
|
88
|
+
"deleteButton": "t_j5va_deleteButton",
|
|
89
|
+
"identity": "t_j5va_identity",
|
|
90
|
+
"saveButton": "t_j5va_saveButton",
|
|
91
|
+
"revealButton": "t_j5va_revealButton",
|
|
92
|
+
"badgeWarn": "t_j5va_badgeWarn",
|
|
93
|
+
"policyBar": "t_j5va_policyBar",
|
|
94
|
+
"pinStar": "t_j5va_pinStar",
|
|
94
95
|
"retryButton": "t_j5va_retryButton",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"secretField": "t_j5va_secretField",
|
|
96
|
+
"pwWeak": "t_j5va_pwWeak",
|
|
97
|
+
"intro": "t_j5va_intro",
|
|
98
|
+
"tabPane": "t_j5va_tabPane",
|
|
99
|
+
"kindChip": "t_j5va_kindChip",
|
|
100
100
|
"title": "t_j5va_title",
|
|
101
|
-
"
|
|
102
|
-
"
|
|
101
|
+
"kindFilter": "t_j5va_kindFilter",
|
|
102
|
+
"list": "t_j5va_list"
|
|
103
103
|
};
|
|
104
104
|
//#endregion
|
|
105
105
|
//#region src/client/VaultSection.tsx
|
package/lib/index.js
CHANGED
|
@@ -1448,6 +1448,60 @@ export async function apply(ctx, config) {
|
|
|
1448
1448
|
return { matched: matched.length, updated: updatedCount, entries: changed };
|
|
1449
1449
|
},
|
|
1450
1450
|
}));
|
|
1451
|
+
// ── vault_bulk_delete: soft-delete entries matching a filter ───────────────
|
|
1452
|
+
ctx.tools.register(defineTool({
|
|
1453
|
+
name: 'vault_bulk_delete',
|
|
1454
|
+
description: 'Soft-delete (move to trash) the entries matching a filter: a search query, a kind, '
|
|
1455
|
+
+ 'a tag, or an explicit list of ids. Pass confirm: true to actually delete — otherwise it only '
|
|
1456
|
+
+ 'reports how many would be deleted. Trashed entries can be restored with vault_restore / '
|
|
1457
|
+
+ 'vault_undelete_all. Returns how many were moved to trash.',
|
|
1458
|
+
parameters: {
|
|
1459
|
+
query: { type: 'string', description: 'Search text selecting entries (title/username/email/host/url/notes/tags). Omit to match by kind/tag/ids.' },
|
|
1460
|
+
kind: { type: 'string', enum: ['login', 'ssh', 'api-key', 'secret', 'oauth', 'cookie', 'card', 'custom'], description: 'Only delete entries of this kind.' },
|
|
1461
|
+
tag: { type: 'string', description: 'Only delete entries carrying this tag.' },
|
|
1462
|
+
ids: { type: 'array', items: { type: 'string' }, description: 'Explicit entry ids to delete (ignores query/kind/tag when provided).' },
|
|
1463
|
+
confirm: { type: 'boolean', description: 'Must be true to move entries to trash (default false = dry run).' },
|
|
1464
|
+
},
|
|
1465
|
+
output: { schema: { type: 'object', additionalProperties: false, properties: { matched: { type: 'integer', required: true }, deleted: { type: 'integer', required: true }, note: { type: 'string', required: true } } }, render: (_a, v) => [{ type: 'text', text: v.note }] },
|
|
1466
|
+
async execute(args) {
|
|
1467
|
+
const s = await guardStore();
|
|
1468
|
+
const all = s.list();
|
|
1469
|
+
let targets;
|
|
1470
|
+
if (Array.isArray(args.ids) && args.ids.length > 0) {
|
|
1471
|
+
const idSet = new Set(args.ids);
|
|
1472
|
+
targets = all.filter(e => idSet.has(e.id));
|
|
1473
|
+
}
|
|
1474
|
+
else {
|
|
1475
|
+
const query = typeof args.query === 'string' ? args.query.trim() : '';
|
|
1476
|
+
let filtered = all;
|
|
1477
|
+
if (args.kind !== undefined)
|
|
1478
|
+
filtered = filtered.filter(e => (e.kind ?? 'login') === args.kind);
|
|
1479
|
+
if (typeof args.tag === 'string' && args.tag.trim().length > 0) {
|
|
1480
|
+
const tag = args.tag.trim();
|
|
1481
|
+
filtered = filtered.filter(e => (e.tags ?? []).includes(tag));
|
|
1482
|
+
}
|
|
1483
|
+
if (query.length > 0) {
|
|
1484
|
+
filtered = filtered.filter(e => {
|
|
1485
|
+
const haystack = [e.title, e.username, e.email, e.phone, e.host, e.url, ...(e.tags ?? [])]
|
|
1486
|
+
.filter((v) => v !== undefined)
|
|
1487
|
+
.join('\n').toLowerCase();
|
|
1488
|
+
return haystack.includes(query.toLowerCase());
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1491
|
+
targets = filtered;
|
|
1492
|
+
}
|
|
1493
|
+
if (args.confirm !== true) {
|
|
1494
|
+
return { matched: targets.length, deleted: 0, note: `bulk delete dry run: ${targets.length} entry/ies would be moved to trash — pass confirm: true to proceed` };
|
|
1495
|
+
}
|
|
1496
|
+
assertWritable('vault_bulk_delete');
|
|
1497
|
+
let deleted = 0;
|
|
1498
|
+
for (const e of targets) {
|
|
1499
|
+
if (await s.delete(e.id))
|
|
1500
|
+
deleted++;
|
|
1501
|
+
}
|
|
1502
|
+
return { matched: targets.length, deleted, note: `bulk delete: ${deleted} entry/ies moved to trash (${targets.length} matched)` };
|
|
1503
|
+
},
|
|
1504
|
+
}));
|
|
1451
1505
|
// ── vault_generate_username: random username/email suggestion ───────────────
|
|
1452
1506
|
ctx.tools.register(defineTool({
|
|
1453
1507
|
name: 'vault_generate_username',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-vault",
|
|
3
|
-
"version": "1.6.0
|
|
3
|
+
"version": "1.6.0",
|
|
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",
|