@principle2026/vault 1.0.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.md +117 -0
- package/SKILL.md +117 -0
- package/dist/CLI.d.ts +58 -0
- package/dist/CLI.d.ts.map +1 -0
- package/dist/CLI.js +180 -0
- package/dist/CLI.js.map +1 -0
- package/dist/Crypto.d.ts +43 -0
- package/dist/Crypto.d.ts.map +1 -0
- package/dist/Crypto.js +136 -0
- package/dist/Crypto.js.map +1 -0
- package/dist/Keychain.d.ts +30 -0
- package/dist/Keychain.d.ts.map +1 -0
- package/dist/Keychain.js +53 -0
- package/dist/Keychain.js.map +1 -0
- package/dist/Store.d.ts +47 -0
- package/dist/Store.d.ts.map +1 -0
- package/dist/Store.js +103 -0
- package/dist/Store.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +342 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.d.ts +65 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +252 -0
- package/dist/tools.js.map +1 -0
- package/package.json +62 -0
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools - Secret operations
|
|
3
|
+
*
|
|
4
|
+
* Core functions for AI to call
|
|
5
|
+
*/
|
|
6
|
+
export declare class VaultNotInitializedError extends Error {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
export declare class SecretNotFoundError extends Error {
|
|
10
|
+
constructor(key: string);
|
|
11
|
+
}
|
|
12
|
+
export interface VaultConfig {
|
|
13
|
+
userId: string;
|
|
14
|
+
passphrase: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Initialize Vault
|
|
18
|
+
*/
|
|
19
|
+
export declare function initVault(userId: string, passphrase: string): Promise<{
|
|
20
|
+
success: boolean;
|
|
21
|
+
message: string;
|
|
22
|
+
storagePath?: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Get secret
|
|
26
|
+
*/
|
|
27
|
+
export declare function getSecret(key: string, passphrase: string): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Set secret
|
|
30
|
+
*/
|
|
31
|
+
export declare function setSecret(key: string, value: string, passphrase: string, description?: string): Promise<{
|
|
32
|
+
success: boolean;
|
|
33
|
+
message: string;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* List all secrets
|
|
37
|
+
*/
|
|
38
|
+
export declare function listSecrets(passphrase: string): Promise<Array<{
|
|
39
|
+
key: string;
|
|
40
|
+
description: string;
|
|
41
|
+
}>>;
|
|
42
|
+
/**
|
|
43
|
+
* Delete secret
|
|
44
|
+
*/
|
|
45
|
+
export declare function deleteSecret(key: string, passphrase: string): Promise<{
|
|
46
|
+
success: boolean;
|
|
47
|
+
message: string;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Get Vault status
|
|
51
|
+
*/
|
|
52
|
+
export declare function getVaultStatus(): Promise<{
|
|
53
|
+
initialized: boolean;
|
|
54
|
+
storageType: 'icloud' | 'local' | 'unknown';
|
|
55
|
+
userId?: string;
|
|
56
|
+
secretCount: number;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Reset Vault
|
|
60
|
+
*/
|
|
61
|
+
export declare function resetVault(): Promise<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
message: string;
|
|
64
|
+
}>;
|
|
65
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8BH,qBAAa,wBAAyB,SAAQ,KAAK;;CAOlD;AAED,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,GAAG,EAAE,MAAM;CAIxB;AAoCD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAA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EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAC,CAaD"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools - Secret operations
|
|
3
|
+
*
|
|
4
|
+
* Core functions for AI to call
|
|
5
|
+
*/
|
|
6
|
+
import { decrypt, encrypt, generateSalt, validatePassphrase, } from './Crypto.js';
|
|
7
|
+
import { deleteMasterKey, getMasterKey, saveMasterKey, saveSalt, } from './Keychain.js';
|
|
8
|
+
import { initStore, readStore, writeStore, } from './Store.js';
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Error types
|
|
11
|
+
// ============================================================================
|
|
12
|
+
export class VaultNotInitializedError extends Error {
|
|
13
|
+
constructor() {
|
|
14
|
+
super('Vault is not initialized. Please run: vault init <username>');
|
|
15
|
+
this.name = 'VaultNotInitializedError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export class SecretNotFoundError extends Error {
|
|
19
|
+
constructor(key) {
|
|
20
|
+
super(`Secret "${key}" not found`);
|
|
21
|
+
this.name = 'SecretNotFoundError';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// Utility functions
|
|
26
|
+
// ============================================================================
|
|
27
|
+
/**
|
|
28
|
+
* Decrypt master key
|
|
29
|
+
*/
|
|
30
|
+
async function decryptMasterKey(encryptedKey, passphrase) {
|
|
31
|
+
try {
|
|
32
|
+
const parsed = JSON.parse(encryptedKey);
|
|
33
|
+
return await decrypt(parsed.encrypted, parsed.salt, passphrase);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
throw new Error('Incorrect passphrase or corrupted master key');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Encrypt master key
|
|
41
|
+
*/
|
|
42
|
+
async function encryptMasterKey(masterKey, passphrase) {
|
|
43
|
+
const result = await encrypt(masterKey, passphrase);
|
|
44
|
+
return JSON.stringify(result);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Initialize Vault
|
|
48
|
+
*/
|
|
49
|
+
export async function initVault(userId, passphrase) {
|
|
50
|
+
try {
|
|
51
|
+
validatePassphrase(passphrase);
|
|
52
|
+
// Check if already exists
|
|
53
|
+
const existingKey = await getMasterKey();
|
|
54
|
+
if (existingKey) {
|
|
55
|
+
return {
|
|
56
|
+
success: false,
|
|
57
|
+
message: 'Vault already exists. To reinitialize, run: vault reset',
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
// Generate master key and salt
|
|
61
|
+
const masterKey = generateSalt();
|
|
62
|
+
const salt = generateSalt();
|
|
63
|
+
// Encrypt master key
|
|
64
|
+
const encryptedKey = await encryptMasterKey(masterKey, passphrase);
|
|
65
|
+
// Save to keychain
|
|
66
|
+
await saveMasterKey(encryptedKey);
|
|
67
|
+
await saveSalt(salt);
|
|
68
|
+
// Initialize storage and get path
|
|
69
|
+
const { getStorageLocation } = await import('./Store.js');
|
|
70
|
+
const location = await getStorageLocation();
|
|
71
|
+
await initStore(userId);
|
|
72
|
+
return {
|
|
73
|
+
success: true,
|
|
74
|
+
message: `Vault initialized successfully! User: ${userId}`,
|
|
75
|
+
storagePath: location.path,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
return {
|
|
80
|
+
success: false,
|
|
81
|
+
message: `Initialization failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get secret
|
|
87
|
+
*/
|
|
88
|
+
export async function getSecret(key, passphrase) {
|
|
89
|
+
// Get encrypted master key
|
|
90
|
+
const encryptedKey = await getMasterKey();
|
|
91
|
+
if (!encryptedKey) {
|
|
92
|
+
throw new VaultNotInitializedError();
|
|
93
|
+
}
|
|
94
|
+
// Decrypt master key
|
|
95
|
+
const masterKey = await decryptMasterKey(encryptedKey, passphrase);
|
|
96
|
+
// Read store
|
|
97
|
+
const store = await readStore();
|
|
98
|
+
if (!store) {
|
|
99
|
+
throw new VaultNotInitializedError();
|
|
100
|
+
}
|
|
101
|
+
// Get secret
|
|
102
|
+
const entry = store.secrets[key];
|
|
103
|
+
if (!entry) {
|
|
104
|
+
throw new SecretNotFoundError(key);
|
|
105
|
+
}
|
|
106
|
+
// Decrypt secret value
|
|
107
|
+
const parsed = JSON.parse(entry.value);
|
|
108
|
+
return await decrypt(parsed.encrypted, parsed.salt, masterKey);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Set secret
|
|
112
|
+
*/
|
|
113
|
+
export async function setSecret(key, value, passphrase, description) {
|
|
114
|
+
try {
|
|
115
|
+
// Validate input
|
|
116
|
+
if (!key || key.trim().length === 0) {
|
|
117
|
+
return { success: false, message: 'Key name cannot be empty' };
|
|
118
|
+
}
|
|
119
|
+
if (!value || value.trim().length === 0) {
|
|
120
|
+
return { success: false, message: 'Secret value cannot be empty' };
|
|
121
|
+
}
|
|
122
|
+
// Get encrypted master key
|
|
123
|
+
const encryptedKey = await getMasterKey();
|
|
124
|
+
if (!encryptedKey) {
|
|
125
|
+
throw new VaultNotInitializedError();
|
|
126
|
+
}
|
|
127
|
+
// Decrypt master key
|
|
128
|
+
const masterKey = await decryptMasterKey(encryptedKey, passphrase);
|
|
129
|
+
// Encrypt secret value
|
|
130
|
+
const encrypted = await encrypt(value, masterKey);
|
|
131
|
+
// Read store
|
|
132
|
+
let store = await readStore();
|
|
133
|
+
if (!store) {
|
|
134
|
+
throw new VaultNotInitializedError();
|
|
135
|
+
}
|
|
136
|
+
// Update secret
|
|
137
|
+
const now = new Date().toISOString();
|
|
138
|
+
const isNew = !store.secrets[key];
|
|
139
|
+
store.secrets[key] = {
|
|
140
|
+
value: JSON.stringify(encrypted),
|
|
141
|
+
description: description || '',
|
|
142
|
+
created_at: isNew ? now : store.secrets[key].created_at,
|
|
143
|
+
updated_at: now,
|
|
144
|
+
};
|
|
145
|
+
// Write store
|
|
146
|
+
await writeStore(store);
|
|
147
|
+
return {
|
|
148
|
+
success: true,
|
|
149
|
+
message: isNew ? `Saved: ${key}` : `Updated: ${key}`,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
if (error instanceof VaultNotInitializedError) {
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
success: false,
|
|
158
|
+
message: `Save failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* List all secrets
|
|
164
|
+
*/
|
|
165
|
+
export async function listSecrets(passphrase) {
|
|
166
|
+
// Get encrypted master key
|
|
167
|
+
const encryptedKey = await getMasterKey();
|
|
168
|
+
if (!encryptedKey) {
|
|
169
|
+
throw new VaultNotInitializedError();
|
|
170
|
+
}
|
|
171
|
+
// Decrypt master key
|
|
172
|
+
await decryptMasterKey(encryptedKey, passphrase);
|
|
173
|
+
// Read store
|
|
174
|
+
const store = await readStore();
|
|
175
|
+
if (!store) {
|
|
176
|
+
throw new VaultNotInitializedError();
|
|
177
|
+
}
|
|
178
|
+
// Return list of secret names (without values)
|
|
179
|
+
return Object.entries(store.secrets).map(([key, entry]) => ({
|
|
180
|
+
key,
|
|
181
|
+
description: entry.description || '',
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Delete secret
|
|
186
|
+
*/
|
|
187
|
+
export async function deleteSecret(key, passphrase) {
|
|
188
|
+
try {
|
|
189
|
+
// Verify passphrase
|
|
190
|
+
const encryptedKey = await getMasterKey();
|
|
191
|
+
if (!encryptedKey) {
|
|
192
|
+
throw new VaultNotInitializedError();
|
|
193
|
+
}
|
|
194
|
+
await decryptMasterKey(encryptedKey, passphrase);
|
|
195
|
+
// Read store
|
|
196
|
+
const store = await readStore();
|
|
197
|
+
if (!store) {
|
|
198
|
+
throw new VaultNotInitializedError();
|
|
199
|
+
}
|
|
200
|
+
// Check if secret exists
|
|
201
|
+
if (!store.secrets[key]) {
|
|
202
|
+
return { success: false, message: `Secret "${key}" not found` };
|
|
203
|
+
}
|
|
204
|
+
// Delete secret
|
|
205
|
+
delete store.secrets[key];
|
|
206
|
+
await writeStore(store);
|
|
207
|
+
return { success: true, message: `Deleted: ${key}` };
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
if (error instanceof VaultNotInitializedError) {
|
|
211
|
+
throw error;
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
success: false,
|
|
215
|
+
message: `Delete failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Get Vault status
|
|
221
|
+
*/
|
|
222
|
+
export async function getVaultStatus() {
|
|
223
|
+
const encryptedKey = await getMasterKey();
|
|
224
|
+
const store = await readStore();
|
|
225
|
+
const { getStorageInfo } = await import('./Store.js');
|
|
226
|
+
const storageInfo = await getStorageInfo();
|
|
227
|
+
return {
|
|
228
|
+
initialized: !!encryptedKey && !!store,
|
|
229
|
+
storageType: storageInfo.type,
|
|
230
|
+
userId: store?.user_id,
|
|
231
|
+
secretCount: store ? Object.keys(store.secrets).length : 0,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Reset Vault
|
|
236
|
+
*/
|
|
237
|
+
export async function resetVault() {
|
|
238
|
+
try {
|
|
239
|
+
await deleteMasterKey();
|
|
240
|
+
return {
|
|
241
|
+
success: true,
|
|
242
|
+
message: 'Vault has been reset. All keys deleted, but encrypted data files still exist in storage.',
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
return {
|
|
247
|
+
success: false,
|
|
248
|
+
message: 'Reset failed',
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL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AAO;QACtB,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC3D,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAI9B,IAAI,CAAC;QACH,MAAM,eAAe,EAAE,CAAA;QACvB,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,0FAA0F;SACpG,CAAA;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,cAAc;SACxB,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@principle2026/vault",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Vault - AI-powered secret management for Claude Code",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"vault": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"SKILL.md",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"dev": "tsc --watch",
|
|
18
|
+
"test": "bun test",
|
|
19
|
+
"prepublishOnly": "npm run build",
|
|
20
|
+
"prepublish": "npm run build",
|
|
21
|
+
"release": "npm version patch && npm publish --access public",
|
|
22
|
+
"release:minor": "npm version minor && npm publish --access public",
|
|
23
|
+
"release:major": "npm version major && npm publish --access public"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"claude-code",
|
|
27
|
+
"skill",
|
|
28
|
+
"vault",
|
|
29
|
+
"secret",
|
|
30
|
+
"keychain",
|
|
31
|
+
"password-manager",
|
|
32
|
+
"encryption"
|
|
33
|
+
],
|
|
34
|
+
"author": "xiaolin26 <xiaolin@example.com>",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/xiaolin26/vault.git"
|
|
39
|
+
},
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/xiaolin26/vault/issues"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/xiaolin26/vault#readme",
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18.0.0"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"keytar": "^7.9.0",
|
|
49
|
+
"yargs": "^17.7.2"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/bun": "latest",
|
|
53
|
+
"@types/node": "^20.11.0",
|
|
54
|
+
"@types/yargs": "^17.0.32",
|
|
55
|
+
"typescript": "^5.3.3"
|
|
56
|
+
},
|
|
57
|
+
"os": [
|
|
58
|
+
"darwin",
|
|
59
|
+
"linux",
|
|
60
|
+
"win32"
|
|
61
|
+
]
|
|
62
|
+
}
|