@framers/agentos-ext-credential-vault 0.1.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/LICENSE ADDED
@@ -0,0 +1,98 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License.
30
+
31
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
+
33
+ 3. Grant of Patent License.
34
+
35
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
36
+
37
+ 4. Redistribution.
38
+
39
+ You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
40
+
41
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
42
+
43
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
44
+
45
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
46
+
47
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
48
+
49
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
50
+
51
+ 5. Submission of Contributions.
52
+
53
+ Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
54
+
55
+ 6. Trademarks.
56
+
57
+ This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
58
+
59
+ 7. Disclaimer of Warranty.
60
+
61
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
62
+
63
+ 8. Limitation of Liability.
64
+
65
+ In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
66
+
67
+ 9. Accepting Warranty or Additional Liability.
68
+
69
+ While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
70
+
71
+ END OF TERMS AND CONDITIONS
72
+
73
+ APPENDIX: How to apply the Apache License to your work.
74
+
75
+ To apply the Apache License to your work, attach the following
76
+ boilerplate notice, with the fields enclosed by brackets "[]"
77
+ replaced with your own identifying information. (Don't include
78
+ the brackets!) The text should be enclosed in the appropriate
79
+ comment syntax for the file format. We also recommend that a
80
+ file or class name and description of purpose be included on the
81
+ same "printed page" as the copyright notice for easier
82
+ identification within third-party archives.
83
+
84
+ Copyright (c) 2025 Framers
85
+
86
+ Licensed under the Apache License, Version 2.0 (the "License");
87
+ you may not use this file except in compliance with the License.
88
+ You may obtain a copy of the License at
89
+
90
+ http://www.apache.org/licenses/LICENSE-2.0
91
+
92
+ Unless required by applicable law or agreed to in writing, software
93
+ distributed under the License is distributed on an "AS IS" BASIS,
94
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
95
+ See the License for the specific language governing permissions and
96
+ limitations under the License.
97
+
98
+
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @fileoverview Credential Vault service layer.
3
+ *
4
+ * Provides AES-256-GCM encrypted in-memory credential storage
5
+ * with platform-scoped keys, rotation, and import/export support.
6
+ * Uses Node.js built-in crypto module (no external dependencies).
7
+ */
8
+ export interface CredentialEntry {
9
+ platform: string;
10
+ key: string;
11
+ encryptedValue: string;
12
+ iv: string;
13
+ authTag: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ rotatedAt?: string;
17
+ }
18
+ export interface CredentialInfo {
19
+ platform: string;
20
+ key: string;
21
+ maskedValue: string;
22
+ createdAt: string;
23
+ updatedAt: string;
24
+ rotatedAt?: string;
25
+ }
26
+ export interface ImportResult {
27
+ imported: number;
28
+ skipped: number;
29
+ errors: string[];
30
+ }
31
+ export declare class CredentialVaultService {
32
+ private store;
33
+ private masterKey;
34
+ private running;
35
+ constructor(passphrase: string);
36
+ initialize(): Promise<void>;
37
+ shutdown(): Promise<void>;
38
+ get isRunning(): boolean;
39
+ setCredential(platform: string, key: string, value: string): Promise<void>;
40
+ getCredential(platform: string, key: string): Promise<string | null>;
41
+ listCredentials(platform?: string): Promise<CredentialInfo[]>;
42
+ deleteCredential(platform: string, key: string): Promise<boolean>;
43
+ importCredentials(data: string, format?: 'json' | 'csv'): Promise<ImportResult>;
44
+ exportCredentials(platform?: string): Promise<Array<{
45
+ platform: string;
46
+ key: string;
47
+ value: string;
48
+ }>>;
49
+ private encrypt;
50
+ private decrypt;
51
+ private buildKey;
52
+ private maskValue;
53
+ private parseCsvLine;
54
+ private requireRunning;
55
+ }
56
+ //# sourceMappingURL=CredentialVaultService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialVaultService.d.ts","sourceRoot":"","sources":["../src/CredentialVaultService.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAQH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,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
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview Credential Vault service layer.
5
+ *
6
+ * Provides AES-256-GCM encrypted in-memory credential storage
7
+ * with platform-scoped keys, rotation, and import/export support.
8
+ * Uses Node.js built-in crypto module (no external dependencies).
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || (function () {
27
+ var ownKeys = function(o) {
28
+ ownKeys = Object.getOwnPropertyNames || function (o) {
29
+ var ar = [];
30
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
31
+ return ar;
32
+ };
33
+ return ownKeys(o);
34
+ };
35
+ return function (mod) {
36
+ if (mod && mod.__esModule) return mod;
37
+ var result = {};
38
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
39
+ __setModuleDefault(result, mod);
40
+ return result;
41
+ };
42
+ })();
43
+ Object.defineProperty(exports, "__esModule", { value: true });
44
+ exports.CredentialVaultService = void 0;
45
+ const crypto = __importStar(require("crypto"));
46
+ // ---------------------------------------------------------------------------
47
+ // Service
48
+ // ---------------------------------------------------------------------------
49
+ class CredentialVaultService {
50
+ constructor(passphrase) {
51
+ this.store = new Map();
52
+ this.running = false;
53
+ // Derive a 256-bit key from the passphrase using scrypt
54
+ this.masterKey = crypto.scryptSync(passphrase, 'agentos-credential-vault-salt', 32);
55
+ }
56
+ async initialize() {
57
+ this.running = true;
58
+ }
59
+ async shutdown() {
60
+ // Clear all credentials from memory on shutdown
61
+ this.store.clear();
62
+ this.running = false;
63
+ }
64
+ get isRunning() {
65
+ return this.running;
66
+ }
67
+ // ── Set Credential ──
68
+ async setCredential(platform, key, value) {
69
+ this.requireRunning();
70
+ const { encrypted, iv, authTag } = this.encrypt(value);
71
+ const storeKey = this.buildKey(platform, key);
72
+ const now = new Date().toISOString();
73
+ const existing = this.store.get(storeKey);
74
+ this.store.set(storeKey, {
75
+ platform,
76
+ key,
77
+ encryptedValue: encrypted,
78
+ iv,
79
+ authTag,
80
+ createdAt: existing?.createdAt ?? now,
81
+ updatedAt: now,
82
+ rotatedAt: existing?.rotatedAt,
83
+ });
84
+ }
85
+ // ── Get Credential ──
86
+ async getCredential(platform, key) {
87
+ this.requireRunning();
88
+ const storeKey = this.buildKey(platform, key);
89
+ const entry = this.store.get(storeKey);
90
+ if (!entry)
91
+ return null;
92
+ return this.decrypt(entry.encryptedValue, entry.iv, entry.authTag);
93
+ }
94
+ // ── List Credentials ──
95
+ async listCredentials(platform) {
96
+ this.requireRunning();
97
+ const results = [];
98
+ for (const entry of this.store.values()) {
99
+ if (platform && entry.platform !== platform)
100
+ continue;
101
+ // Decrypt to get value length for masking, then discard
102
+ const value = this.decrypt(entry.encryptedValue, entry.iv, entry.authTag);
103
+ const maskedValue = this.maskValue(value);
104
+ results.push({
105
+ platform: entry.platform,
106
+ key: entry.key,
107
+ maskedValue,
108
+ createdAt: entry.createdAt,
109
+ updatedAt: entry.updatedAt,
110
+ rotatedAt: entry.rotatedAt,
111
+ });
112
+ }
113
+ return results.sort((a, b) => {
114
+ const cmp = a.platform.localeCompare(b.platform);
115
+ return cmp !== 0 ? cmp : a.key.localeCompare(b.key);
116
+ });
117
+ }
118
+ // ── Delete Credential ──
119
+ async deleteCredential(platform, key) {
120
+ this.requireRunning();
121
+ const storeKey = this.buildKey(platform, key);
122
+ return this.store.delete(storeKey);
123
+ }
124
+ // ── Import Credentials ──
125
+ async importCredentials(data, format = 'json') {
126
+ this.requireRunning();
127
+ const result = { imported: 0, skipped: 0, errors: [] };
128
+ if (format === 'json') {
129
+ try {
130
+ const parsed = JSON.parse(data);
131
+ const entries = Array.isArray(parsed) ? parsed : [parsed];
132
+ for (const entry of entries) {
133
+ if (!entry.platform || !entry.key || !entry.value) {
134
+ result.errors.push(`Invalid entry: missing platform, key, or value`);
135
+ result.skipped++;
136
+ continue;
137
+ }
138
+ try {
139
+ await this.setCredential(entry.platform, entry.key, entry.value);
140
+ result.imported++;
141
+ }
142
+ catch (err) {
143
+ result.errors.push(`Failed to import ${entry.platform}/${entry.key}: ${err.message}`);
144
+ result.skipped++;
145
+ }
146
+ }
147
+ }
148
+ catch (err) {
149
+ result.errors.push(`Failed to parse JSON: ${err.message}`);
150
+ }
151
+ }
152
+ else if (format === 'csv') {
153
+ const lines = data.split('\n').filter((l) => l.trim());
154
+ // Skip header row if present
155
+ const startIdx = lines[0]?.toLowerCase().includes('platform') ? 1 : 0;
156
+ for (let i = startIdx; i < lines.length; i++) {
157
+ const parts = this.parseCsvLine(lines[i]);
158
+ if (parts.length < 3) {
159
+ result.errors.push(`Line ${i + 1}: expected at least 3 columns (platform, key, value)`);
160
+ result.skipped++;
161
+ continue;
162
+ }
163
+ const [platform, key, value] = parts;
164
+ try {
165
+ await this.setCredential(platform.trim(), key.trim(), value.trim());
166
+ result.imported++;
167
+ }
168
+ catch (err) {
169
+ result.errors.push(`Line ${i + 1}: ${err.message}`);
170
+ result.skipped++;
171
+ }
172
+ }
173
+ }
174
+ return result;
175
+ }
176
+ // ── Export Credentials ──
177
+ async exportCredentials(platform) {
178
+ this.requireRunning();
179
+ const exported = [];
180
+ for (const entry of this.store.values()) {
181
+ if (platform && entry.platform !== platform)
182
+ continue;
183
+ const value = this.decrypt(entry.encryptedValue, entry.iv, entry.authTag);
184
+ exported.push({ platform: entry.platform, key: entry.key, value });
185
+ }
186
+ return exported.sort((a, b) => {
187
+ const cmp = a.platform.localeCompare(b.platform);
188
+ return cmp !== 0 ? cmp : a.key.localeCompare(b.key);
189
+ });
190
+ }
191
+ // ── Private: Encryption ──
192
+ encrypt(plaintext) {
193
+ const iv = crypto.randomBytes(12); // 96-bit IV for GCM
194
+ const cipher = crypto.createCipheriv('aes-256-gcm', this.masterKey, iv);
195
+ let encrypted = cipher.update(plaintext, 'utf8', 'hex');
196
+ encrypted += cipher.final('hex');
197
+ const authTag = cipher.getAuthTag().toString('hex');
198
+ return {
199
+ encrypted,
200
+ iv: iv.toString('hex'),
201
+ authTag,
202
+ };
203
+ }
204
+ decrypt(encryptedHex, ivHex, authTagHex) {
205
+ const iv = Buffer.from(ivHex, 'hex');
206
+ const authTag = Buffer.from(authTagHex, 'hex');
207
+ const decipher = crypto.createDecipheriv('aes-256-gcm', this.masterKey, iv);
208
+ decipher.setAuthTag(authTag);
209
+ let decrypted = decipher.update(encryptedHex, 'hex', 'utf8');
210
+ decrypted += decipher.final('utf8');
211
+ return decrypted;
212
+ }
213
+ // ── Private: Helpers ──
214
+ buildKey(platform, key) {
215
+ return `${platform}::${key}`;
216
+ }
217
+ maskValue(value) {
218
+ if (value.length <= 4)
219
+ return '****';
220
+ const visibleLen = Math.min(4, Math.floor(value.length * 0.2));
221
+ return value.slice(0, visibleLen) + '*'.repeat(Math.max(4, value.length - visibleLen));
222
+ }
223
+ parseCsvLine(line) {
224
+ const parts = [];
225
+ let current = '';
226
+ let inQuotes = false;
227
+ for (let i = 0; i < line.length; i++) {
228
+ const char = line[i];
229
+ if (char === '"') {
230
+ if (inQuotes && line[i + 1] === '"') {
231
+ current += '"';
232
+ i++;
233
+ }
234
+ else {
235
+ inQuotes = !inQuotes;
236
+ }
237
+ }
238
+ else if (char === ',' && !inQuotes) {
239
+ parts.push(current);
240
+ current = '';
241
+ }
242
+ else {
243
+ current += char;
244
+ }
245
+ }
246
+ parts.push(current);
247
+ return parts;
248
+ }
249
+ requireRunning() {
250
+ if (!this.running)
251
+ throw new Error('CredentialVaultService not initialized');
252
+ }
253
+ }
254
+ exports.CredentialVaultService = CredentialVaultService;
255
+ //# sourceMappingURL=CredentialVaultService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialVaultService.js","sourceRoot":"","sources":["../src/CredentialVaultService.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAiC;AAgCjC,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,MAAa,sBAAsB;IAKjC,YAAY,UAAkB;QAJtB,UAAK,GAAiC,IAAI,GAAG,EAAE,CAAC;QAEhD,YAAO,GAAG,KAAK,CAAC;QAGtB,wDAAwD;QACxD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,+BAA+B,EAAE,EAAE,CAAC,CAAC;IACtF,CAAC;IAED,KAAK,CAAC,UAAU;QACd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,gDAAgD;QAChD,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,uBAAuB;IAEvB,KAAK,CAAC,aAAa,CAAC,QAAgB,EAAE,GAAW,EAAE,KAAa;QAC9D,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC9C,MA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AY;QAC/B,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,OAAO,GAAG,EAAE,CAAC;QACjB,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAErB,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;gBACjB,IAAI,QAAQ,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;oBACpC,OAAO,IAAI,GAAG,CAAC;oBACf,CAAC,EAAE,CAAC;gBACN,CAAC;qBAAM,CAAC;oBACN,QAAQ,GAAG,CAAC,QAAQ,CAAC;gBACvB,CAAC;YACH,CAAC;iBAAM,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACrC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACpB,OAAO,GAAG,EAAE,CAAC;YACf,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,IAAI,CAAC;YAClB,CAAC;QACH,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,cAAc;QACpB,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC/E,CAAC;CACF;AA9PD,wDA8PC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @fileoverview Credential Vault Extension for AgentOS.
3
+ *
4
+ * Provides 5 tools for encrypted credential management — store, retrieve,
5
+ * list, rotate, and import credentials using AES-256-GCM encryption.
6
+ *
7
+ * @module @framers/agentos-ext-credential-vault
8
+ */
9
+ export interface CredentialVaultOptions {
10
+ passphrase?: string;
11
+ secrets?: Record<string, string>;
12
+ }
13
+ export interface ExtensionContext {
14
+ options?: Record<string, unknown>;
15
+ secrets?: Record<string, string>;
16
+ }
17
+ export interface ExtensionPack {
18
+ name: string;
19
+ version: string;
20
+ descriptors: Array<{
21
+ id: string;
22
+ kind: string;
23
+ priority?: number;
24
+ payload: unknown;
25
+ }>;
26
+ onActivate?: () => Promise<void>;
27
+ onDeactivate?: () => Promise<void>;
28
+ }
29
+ export declare function createExtensionPack(context: ExtensionContext): ExtensionPack;
30
+ export { CredentialVaultService } from './CredentialVaultService.js';
31
+ export type { CredentialEntry, CredentialInfo, ImportResult } from './CredentialVaultService.js';
32
+ export { CredentialsSetTool } from './tools/set.js';
33
+ export { CredentialsGetTool } from './tools/get.js';
34
+ export { CredentialsListTool } from './tools/list.js';
35
+ export { CredentialsRotateTool } from './tools/rotate.js';
36
+ export { CredentialsImportTool } from './tools/import.js';
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAaH,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAmBD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACtF,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAMD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CA8B5E;AAMD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview Credential Vault Extension for AgentOS.
5
+ *
6
+ * Provides 5 tools for encrypted credential management — store, retrieve,
7
+ * list, rotate, and import credentials using AES-256-GCM encryption.
8
+ *
9
+ * @module @framers/agentos-ext-credential-vault
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CredentialsImportTool = exports.CredentialsRotateTool = exports.CredentialsListTool = exports.CredentialsGetTool = exports.CredentialsSetTool = exports.CredentialVaultService = void 0;
13
+ exports.createExtensionPack = createExtensionPack;
14
+ const CredentialVaultService_js_1 = require("./CredentialVaultService.js");
15
+ const set_js_1 = require("./tools/set.js");
16
+ const get_js_1 = require("./tools/get.js");
17
+ const list_js_1 = require("./tools/list.js");
18
+ const rotate_js_1 = require("./tools/rotate.js");
19
+ const import_js_1 = require("./tools/import.js");
20
+ // ---------------------------------------------------------------------------
21
+ // Secret Resolution
22
+ // ---------------------------------------------------------------------------
23
+ function resolvePassphrase(opts, secrets) {
24
+ return (opts.passphrase ??
25
+ secrets['credential-vault.passphrase'] ??
26
+ process.env.CREDENTIAL_VAULT_PASSPHRASE ??
27
+ 'agentos-default-vault-passphrase');
28
+ }
29
+ // ---------------------------------------------------------------------------
30
+ // Factory
31
+ // ---------------------------------------------------------------------------
32
+ function createExtensionPack(context) {
33
+ const opts = (context.options ?? {});
34
+ const secrets = opts.secrets ?? context.secrets ?? {};
35
+ const passphrase = resolvePassphrase(opts, secrets);
36
+ const service = new CredentialVaultService_js_1.CredentialVaultService(passphrase);
37
+ const setTool = new set_js_1.CredentialsSetTool(service);
38
+ const getTool = new get_js_1.CredentialsGetTool(service);
39
+ const listTool = new list_js_1.CredentialsListTool(service);
40
+ const rotateTool = new rotate_js_1.CredentialsRotateTool(service);
41
+ const importTool = new import_js_1.CredentialsImportTool(service);
42
+ return {
43
+ name: '@framers/agentos-ext-credential-vault',
44
+ version: '0.1.0',
45
+ descriptors: [
46
+ { id: 'credentialsSet', kind: 'tool', priority: 50, payload: setTool },
47
+ { id: 'credentialsGet', kind: 'tool', priority: 50, payload: getTool },
48
+ { id: 'credentialsList', kind: 'tool', priority: 50, payload: listTool },
49
+ { id: 'credentialsRotate', kind: 'tool', priority: 50, payload: rotateTool },
50
+ { id: 'credentialsImport', kind: 'tool', priority: 50, payload: importTool },
51
+ ],
52
+ onActivate: async () => {
53
+ await service.initialize();
54
+ },
55
+ onDeactivate: async () => {
56
+ await service.shutdown();
57
+ },
58
+ };
59
+ }
60
+ // ---------------------------------------------------------------------------
61
+ // Public exports
62
+ // ---------------------------------------------------------------------------
63
+ var CredentialVaultService_js_2 = require("./CredentialVaultService.js");
64
+ Object.defineProperty(exports, "CredentialVaultService", { enumerable: true, get: function () { return CredentialVaultService_js_2.CredentialVaultService; } });
65
+ var set_js_2 = require("./tools/set.js");
66
+ Object.defineProperty(exports, "CredentialsSetTool", { enumerable: true, get: function () { return set_js_2.CredentialsSetTool; } });
67
+ var get_js_2 = require("./tools/get.js");
68
+ Object.defineProperty(exports, "CredentialsGetTool", { enumerable: true, get: function () { return get_js_2.CredentialsGetTool; } });
69
+ var list_js_2 = require("./tools/list.js");
70
+ Object.defineProperty(exports, "CredentialsListTool", { enumerable: true, get: function () { return list_js_2.CredentialsListTool; } });
71
+ var rotate_js_2 = require("./tools/rotate.js");
72
+ Object.defineProperty(exports, "CredentialsRotateTool", { enumerable: true, get: function () { return rotate_js_2.CredentialsRotateTool; } });
73
+ var import_js_2 = require("./tools/import.js");
74
+ Object.defineProperty(exports, "CredentialsImportTool", { enumerable: true, get: function () { return import_js_2.CredentialsImportTool; } });
75
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;;;;;;GAOG;;;AAoDH,kDA8BC;AAhFD,2EAAqE;AACrE,2CAAoD;AACpD,2CAAoD;AACpD,6CAAsD;AACtD,iDAA0D;AAC1D,iDAA0D;AAW1D,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,SAAS,iBAAiB,CAAC,IAA4B,EAAE,OAA+B;IACtF,OAAO,CACL,IAAI,CAAC,UAAU;QACf,OAAO,CAAC,6BAA6B,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,2BAA2B;QACvC,kCAAkC,CACnC,CAAC;AACJ,CAAC;AAmBD,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAgB,mBAAmB,CAAC,OAAyB;IAC3D,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAA2B,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IACtD,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,IAAI,kDAAsB,CAAC,UAAU,CAAC,CA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AAA5D,mIAAA,sBAAsB,OAAA;AAE/B,yCAAoD;AAA3C,4GAAA,kBAAkB,OAAA;AAC3B,yCAAoD;AAA3C,4GAAA,kBAAkB,OAAA;AAC3B,2CAAsD;AAA7C,8GAAA,mBAAmB,OAAA;AAC5B,+CAA0D;AAAjD,kHAAA,qBAAqB,OAAA;AAC9B,+CAA0D;AAAjD,kHAAA,qBAAqB,OAAA"}
@@ -0,0 +1,35 @@
1
+ import type { CredentialVaultService } from '../CredentialVaultService.js';
2
+ export declare class CredentialsGetTool {
3
+ private service;
4
+ readonly id = "credentialsGet";
5
+ readonly name = "credentialsGet";
6
+ readonly displayName = "Retrieve Credential";
7
+ readonly description = "Retrieve a decrypted credential from the vault by platform and key.";
8
+ readonly category = "security";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = false;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ platform: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ key: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ };
23
+ required: string[];
24
+ };
25
+ constructor(service: CredentialVaultService);
26
+ execute(args: {
27
+ platform: string;
28
+ key: string;
29
+ }): Promise<{
30
+ success: boolean;
31
+ data?: any;
32
+ error?: string;
33
+ }>;
34
+ }
35
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/tools/get.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,qBAAa,kBAAkB;IAkBjB,OAAO,CAAC,OAAO;IAjB3B,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,yBAAyB;IAC7C,QAAQ,CAAC,WAAW,yEAAyE;IAC7F,QAAQ,CAAC,QAAQ,cAAc;IAC/B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;MAOlB;gBAEkB,OAAO,EAAE,sBAAsB;IAE7C,OAAO,CAAC,IAAI,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;KACb,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAiB9D"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CredentialsGetTool = void 0;
4
+ class CredentialsGetTool {
5
+ constructor(service) {
6
+ this.service = service;
7
+ this.id = 'credentialsGet';
8
+ this.name = 'credentialsGet';
9
+ this.displayName = 'Retrieve Credential';
10
+ this.description = 'Retrieve a decrypted credential from the vault by platform and key.';
11
+ this.category = 'security';
12
+ this.version = '0.1.0';
13
+ this.hasSideEffects = false;
14
+ this.inputSchema = {
15
+ type: 'object',
16
+ properties: {
17
+ platform: { type: 'string', description: 'Platform or service name (e.g., "twitter", "openai")' },
18
+ key: { type: 'string', description: 'Credential key (e.g., "apiKey", "accessToken")' },
19
+ },
20
+ required: ['platform', 'key'],
21
+ };
22
+ }
23
+ async execute(args) {
24
+ try {
25
+ const value = await this.service.getCredential(args.platform, args.key);
26
+ if (value === null) {
27
+ return {
28
+ success: false,
29
+ error: `Credential not found: ${args.platform}/${args.key}`,
30
+ };
31
+ }
32
+ return {
33
+ success: true,
34
+ data: { platform: args.platform, key: args.key, value },
35
+ };
36
+ }
37
+ catch (err) {
38
+ return { success: false, error: err.message };
39
+ }
40
+ }
41
+ }
42
+ exports.CredentialsGetTool = CredentialsGetTool;
43
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/tools/get.ts"],"names":[],"mappings":";;;AAGA,MAAa,k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ChD,CAAC;IACH,CAAC;CACF;AAxCD,gDAwCC"}
@@ -0,0 +1,36 @@
1
+ import type { CredentialVaultService } from '../CredentialVaultService.js';
2
+ export declare class CredentialsImportTool {
3
+ private service;
4
+ readonly id = "credentialsImport";
5
+ readonly name = "credentialsImport";
6
+ readonly displayName = "Import Credentials";
7
+ readonly description = "Import credentials from JSON array or CSV data into the encrypted vault.";
8
+ readonly category = "security";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = true;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ data: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ format: {
19
+ type: string;
20
+ enum: string[];
21
+ description: string;
22
+ };
23
+ };
24
+ required: string[];
25
+ };
26
+ constructor(service: CredentialVaultService);
27
+ execute(args: {
28
+ data: string;
29
+ format?: 'json' | 'csv';
30
+ }): Promise<{
31
+ success: boolean;
32
+ data?: any;
33
+ error?: string;
34
+ }>;
35
+ }
36
+ //# sourceMappingURL=import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/tools/import.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,qBAAa,qBAAqB;IAyBpB,OAAO,CAAC,OAAO;IAxB3B,QAAQ,CAAC,EAAE,uBAAuB;IAClC,QAAQ,CAAC,IAAI,uBAAuB;IACpC,QAAQ,CAAC,WAAW,wBAAwB;IAC5C,QAAQ,CAAC,WAAW,8EAA8E;IAClG,QAAQ,CAAC,QAAQ,cAAc;IAC/B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;MAclB;gBAEkB,OAAO,EAAE,sBAAsB;IAE7C,OAAO,CAAC,IAAI,EAAE;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;KACzB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAmB9D"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CredentialsImportTool = void 0;
4
+ class CredentialsImportTool {
5
+ constructor(service) {
6
+ this.service = service;
7
+ this.id = 'credentialsImport';
8
+ this.name = 'credentialsImport';
9
+ this.displayName = 'Import Credentials';
10
+ this.description = 'Import credentials from JSON array or CSV data into the encrypted vault.';
11
+ this.category = 'security';
12
+ this.version = '0.1.0';
13
+ this.hasSideEffects = true;
14
+ this.inputSchema = {
15
+ type: 'object',
16
+ properties: {
17
+ data: {
18
+ type: 'string',
19
+ description: 'Credential data as JSON array (e.g., [{"platform":"x","key":"apiKey","value":"sk-..."}]) or CSV (platform,key,value per line)',
20
+ },
21
+ format: {
22
+ type: 'string',
23
+ enum: ['json', 'csv'],
24
+ description: 'Data format (default: json)',
25
+ },
26
+ },
27
+ required: ['data'],
28
+ };
29
+ }
30
+ async execute(args) {
31
+ try {
32
+ const result = await this.service.importCredentials(args.data, args.format ?? 'json');
33
+ return {
34
+ success: true,
35
+ data: {
36
+ imported: result.imported,
37
+ skipped: result.skipped,
38
+ errors: result.errors.length > 0 ? result.errors : undefined,
39
+ message: `Imported ${result.imported} credential(s), skipped ${result.skipped}`,
40
+ },
41
+ };
42
+ }
43
+ catch (err) {
44
+ return { success: false, error: err.message };
45
+ }
46
+ }
47
+ }
48
+ exports.CredentialsImportTool = CredentialsImportTool;
49
+ //# sourceMappingURL=import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/tools/import.ts"],"names":[],"mappings":";;;AAGA,MAAa,qBAAqB;IAyBhC,YAAoB,OAA+B;QAA/B,YAAO,GAAP,OAAO,CAAwB;QAxB1C,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ACH,CAAC;CACF;AAjDD,sDAiDC"}
@@ -0,0 +1,29 @@
1
+ import type { CredentialVaultService } from '../CredentialVaultService.js';
2
+ export declare class CredentialsListTool {
3
+ private service;
4
+ readonly id = "credentialsList";
5
+ readonly name = "credentialsList";
6
+ readonly displayName = "List Credentials";
7
+ readonly description = "List stored credentials with masked values. Optionally filter by platform.";
8
+ readonly category = "security";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = false;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ platform: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ };
19
+ };
20
+ constructor(service: CredentialVaultService);
21
+ execute(args: {
22
+ platform?: string;
23
+ }): Promise<{
24
+ success: boolean;
25
+ data?: any;
26
+ error?: string;
27
+ }>;
28
+ }
29
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,qBAAa,mBAAmB;IAgBlB,OAAO,CAAC,OAAO;IAf3B,QAAQ,CAAC,EAAE,qBAAqB;IAChC,QAAQ,CAAC,IAAI,qBAAqB;IAClC,QAAQ,CAAC,WAAW,sBAAsB;IAC1C,QAAQ,CAAC,WAAW,gFAAgF;IACpG,QAAQ,CAAC,QAAQ,cAAc;IAC/B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;MAKlB;gBAEkB,OAAO,EAAE,sBAAsB;IAE7C,OAAO,CAAC,IAAI,EAAE;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAW9D"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CredentialsListTool = void 0;
4
+ class CredentialsListTool {
5
+ constructor(service) {
6
+ this.service = service;
7
+ this.id = 'credentialsList';
8
+ this.name = 'credentialsList';
9
+ this.displayName = 'List Credentials';
10
+ this.description = 'List stored credentials with masked values. Optionally filter by platform.';
11
+ this.category = 'security';
12
+ this.version = '0.1.0';
13
+ this.hasSideEffects = false;
14
+ this.inputSchema = {
15
+ type: 'object',
16
+ properties: {
17
+ platform: { type: 'string', description: 'Optional platform filter to list credentials for a specific service' },
18
+ },
19
+ };
20
+ }
21
+ async execute(args) {
22
+ try {
23
+ const credentials = await this.service.listCredentials(args.platform);
24
+ return {
25
+ success: true,
26
+ data: { credentials, count: credentials.length },
27
+ };
28
+ }
29
+ catch (err) {
30
+ return { success: false, error: err.message };
31
+ }
32
+ }
33
+ }
34
+ exports.CredentialsListTool = CredentialsListTool;
35
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":";;;AAGA,MAAa,mBAAmB;IAgB9B,YAAoB,OAA+B;QAA/B,YAAO,GAAP,OAAO,CAAwB;QAf1C,OAAE,GAAG,iBAAiB,CAAC;QACvB,SAAI,GAAG,iBAAiB,CAAC;QACzB,gBAAW,GAAG,kBAAkB,CAAC;QACjC,gBAAW,GAAG,4EAA4E,CAAC;QAC3F,aAAQ,GAAG,UAAU,CAAC;QACtB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,KAAK,CAAC;QAEvB,gBAAW,GAAG;YACrB,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qEAAqE,EAAE;aACjH;SACF,CAAC;IAEoD,CAAC;IAEvD,KAAK,CAAC,OAAO,CAAC,IAEb;QACC,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtE,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE;aACjD,CAAC;QACJ,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AA/BD,kDA+BC"}
@@ -0,0 +1,40 @@
1
+ import type { CredentialVaultService } from '../CredentialVaultService.js';
2
+ export declare class CredentialsRotateTool {
3
+ private service;
4
+ readonly id = "credentialsRotate";
5
+ readonly name = "credentialsRotate";
6
+ readonly displayName = "Rotate Credential";
7
+ readonly description = "Rotate an existing credential by updating its value and marking rotation timestamp. Useful for OAuth token refresh.";
8
+ readonly category = "security";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = true;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ platform: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ key: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ refreshToken: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ };
27
+ required: string[];
28
+ };
29
+ constructor(service: CredentialVaultService);
30
+ execute(args: {
31
+ platform: string;
32
+ key: string;
33
+ refreshToken: string;
34
+ }): Promise<{
35
+ success: boolean;
36
+ data?: any;
37
+ error?: string;
38
+ }>;
39
+ }
40
+ //# sourceMappingURL=rotate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/tools/rotate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,qBAAa,qBAAqB;IAmBpB,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,uBAAuB;IAClC,QAAQ,CAAC,IAAI,uBAAuB;IACpC,QAAQ,CAAC,WAAW,uBAAuB;IAC3C,QAAQ,CAAC,WAAW,yHAAyH;IAC7I,QAAQ,CAAC,QAAQ,cAAc;IAC/B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,sBAAsB;IAE7C,OAAO,CAAC,IAAI,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,YAAY,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CA2B9D"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CredentialsRotateTool = void 0;
4
+ class CredentialsRotateTool {
5
+ constructor(service) {
6
+ this.service = service;
7
+ this.id = 'credentialsRotate';
8
+ this.name = 'credentialsRotate';
9
+ this.displayName = 'Rotate Credential';
10
+ this.description = 'Rotate an existing credential by updating its value and marking rotation timestamp. Useful for OAuth token refresh.';
11
+ this.category = 'security';
12
+ this.version = '0.1.0';
13
+ this.hasSideEffects = true;
14
+ this.inputSchema = {
15
+ type: 'object',
16
+ properties: {
17
+ platform: { type: 'string', description: 'Platform or service name' },
18
+ key: { type: 'string', description: 'Credential key to rotate' },
19
+ refreshToken: { type: 'string', description: 'New credential value or refresh token' },
20
+ },
21
+ required: ['platform', 'key', 'refreshToken'],
22
+ };
23
+ }
24
+ async execute(args) {
25
+ try {
26
+ // Verify the credential exists before rotating
27
+ const existing = await this.service.getCredential(args.platform, args.key);
28
+ if (existing === null) {
29
+ return {
30
+ success: false,
31
+ error: `Credential not found: ${args.platform}/${args.key}. Cannot rotate a non-existent credential.`,
32
+ };
33
+ }
34
+ // Store the new value (setCredential preserves createdAt and updates updatedAt)
35
+ await this.service.setCredential(args.platform, args.key, args.refreshToken);
36
+ return {
37
+ success: true,
38
+ data: {
39
+ platform: args.platform,
40
+ key: args.key,
41
+ rotatedAt: new Date().toISOString(),
42
+ message: `Credential rotated for ${args.platform}/${args.key}`,
43
+ },
44
+ };
45
+ }
46
+ catch (err) {
47
+ return { success: false, error: err.message };
48
+ }
49
+ }
50
+ }
51
+ exports.CredentialsRotateTool = CredentialsRotateTool;
52
+ //# sourceMappingURL=rotate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate.js","sourceRoot":"","sources":["../../src/tools/rotate.ts"],"names":[],"mappings":";;;AAGA,MAAa,qBAAqB;IAmBhC,YAAoB,OAA+B;QAA/B,YAAO,GAAP,OAAO,CAAwB;QAlB1C,OAAE,GAAG,mBAAmB,CAAC;QACzB,SAAI,GAAG,mBAAmB,CAAC;QAC3B,gBAAW,GAAG,mBAAmB,CAAC;QAClC,gBAAW,GAAG,qHAAqH,CAAC;QACpI,aAAQ,GAAG,UAAU,CAAC;QACtB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YACrB,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;gBACrE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;gBAChE,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;aACvF;YACD,QAAQ,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,cAAc,CAAC;SAC9C,CAAC;IAEoD,CAAC;IAEvD,KAAK,CAAC,OAAO,CAAC,IAIb;QACC,IAAI,CAAC;YACH,+CAA+C;YAC/C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC3E,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,yBAAyB,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,GAAG,4CAA4C;iBACtG,CAAC;YACJ,CAAC;YAED,gFAAgF;YAChF,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YAE7E,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE;oBACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBACnC,OAAO,EAAE,0BAA0B,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,GAAG,EAAE;iBAC/D;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AApDD,sDAoDC"}
@@ -0,0 +1,40 @@
1
+ import type { CredentialVaultService } from '../CredentialVaultService.js';
2
+ export declare class CredentialsSetTool {
3
+ private service;
4
+ readonly id = "credentialsSet";
5
+ readonly name = "credentialsSet";
6
+ readonly displayName = "Store Credential";
7
+ readonly description = "Store an encrypted credential in the vault, scoped by platform and key.";
8
+ readonly category = "security";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = true;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ platform: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ key: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ value: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ };
27
+ required: string[];
28
+ };
29
+ constructor(service: CredentialVaultService);
30
+ execute(args: {
31
+ platform: string;
32
+ key: string;
33
+ value: string;
34
+ }): Promise<{
35
+ success: boolean;
36
+ data?: any;
37
+ error?: string;
38
+ }>;
39
+ }
40
+ //# sourceMappingURL=set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/tools/set.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,qBAAa,kBAAkB;IAmBjB,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,sBAAsB;IAC1C,QAAQ,CAAC,WAAW,6EAA6E;IACjG,QAAQ,CAAC,QAAQ,cAAc;IAC/B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,sBAAsB;IAE7C,OAAO,CAAC,IAAI,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAe9D"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CredentialsSetTool = void 0;
4
+ class CredentialsSetTool {
5
+ constructor(service) {
6
+ this.service = service;
7
+ this.id = 'credentialsSet';
8
+ this.name = 'credentialsSet';
9
+ this.displayName = 'Store Credential';
10
+ this.description = 'Store an encrypted credential in the vault, scoped by platform and key.';
11
+ this.category = 'security';
12
+ this.version = '0.1.0';
13
+ this.hasSideEffects = true;
14
+ this.inputSchema = {
15
+ type: 'object',
16
+ properties: {
17
+ platform: { type: 'string', description: 'Platform or service name (e.g., "twitter", "openai", "github")' },
18
+ key: { type: 'string', description: 'Credential key (e.g., "apiKey", "accessToken", "password")' },
19
+ value: { type: 'string', description: 'Credential value to encrypt and store' },
20
+ },
21
+ required: ['platform', 'key', 'value'],
22
+ };
23
+ }
24
+ async execute(args) {
25
+ try {
26
+ await this.service.setCredential(args.platform, args.key, args.value);
27
+ return {
28
+ success: true,
29
+ data: {
30
+ platform: args.platform,
31
+ key: args.key,
32
+ message: `Credential stored for ${args.platform}/${args.key}`,
33
+ },
34
+ };
35
+ }
36
+ catch (err) {
37
+ return { success: false, error: err.message };
38
+ }
39
+ }
40
+ }
41
+ exports.CredentialsSetTool = CredentialsSetTool;
42
+ //# sourceMappingURL=set.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.js","sourceRoot":"","sources":["../../src/tools/set.ts"],"names":[],"mappings":";;;AAGA,MAAa,kBAAkB;IAmB7B,YAAoB,OAA+B;QAA/B,YAAO,GAAP,OAAO,CAAwB;QAlB1C,OAAE,GAAG,gBAAgB,CAAC;QACtB,SAAI,GAAG,gBAAgB,CAAC;QACxB,gBAAW,GAAG,kBAAkB,CAAC;QACjC,gBAAW,GAAG,yEAAyE,CAAC;QACxF,aAAQ,GAAG,UAAU,CAAC;QACtB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YACrB,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gEAAgE,EAAE;gBAC3G,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4DAA4D,EAAE;gBAClG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;aAChF;YACD,QAAQ,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC;SACvC,CAAC;IAEoD,CAAC;IAEvD,KAAK,CAAC,OAAO,CAAC,IAIb;QACC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YACtE,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE;oBACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,OAAO,EAAE,yBAAyB,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,GAAG,EAAE;iBAC9D;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAxCD,gDAwCC"}
package/manifest.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
3
+ "id": "com.framers.system.credential-vault",
4
+ "name": "Credential Vault Extension",
5
+ "version": "0.1.0",
6
+ "description": "Encrypted in-memory credential storage with AES-256-GCM encryption, OAuth token rotation, and credential import/export.",
7
+ "categories": ["system", "security"],
8
+ "extensions": [
9
+ { "kind": "tool", "id": "credentialsSet", "displayName": "Store Credential" },
10
+ { "kind": "tool", "id": "credentialsGet", "displayName": "Retrieve Credential" },
11
+ { "kind": "tool", "id": "credentialsList", "displayName": "List Credentials" },
12
+ { "kind": "tool", "id": "credentialsRotate", "displayName": "Rotate Credential" },
13
+ { "kind": "tool", "id": "credentialsImport", "displayName": "Import Credentials" }
14
+ ],
15
+ "requiredSecrets": [],
16
+ "features": [
17
+ "AES-256-GCM encrypted in-memory credential storage",
18
+ "Store and retrieve credentials by platform and key",
19
+ "List stored credentials with masked values",
20
+ "Rotate OAuth tokens and API keys",
21
+ "Import credentials from JSON or CSV format"
22
+ ]
23
+ }
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@framers/agentos-ext-credential-vault",
3
+ "version": "0.1.0",
4
+ "description": "Credential vault extension for AgentOS — encrypted in-memory credential storage with AES-256-GCM, rotation support, and import/export.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "manifest.json"
10
+ ],
11
+ "peerDependencies": {
12
+ "@framers/agentos": "^0.5.2"
13
+ },
14
+ "devDependencies": {
15
+ "@framers/agentos": "^0.6.6",
16
+ "@types/node": "^20.0.0",
17
+ "typescript": "^5.0.0",
18
+ "vitest": "^1.0.0"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/framersai/agentos-extensions",
23
+ "directory": "registry/curated/system/credential-vault"
24
+ },
25
+ "scripts": {
26
+ "build": "tsc",
27
+ "dev": "tsc --watch",
28
+ "test": "vitest run",
29
+ "test:watch": "vitest watch",
30
+ "clean": "rm -rf dist"
31
+ }
32
+ }