@framers/agentos-ext-credential-vault 0.1.1 → 0.1.3

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.
Files changed (3) hide show
  1. package/README.md +101 -0
  2. package/manifest.json +1 -1
  3. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # Credential vault
2
+
3
+ This pack gives an agent tools to store, retrieve, list, rotate, and import credentials scoped by platform and key. It uses Node.js `crypto` for `AES-256-GCM` encryption and keeps credentials in memory.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @framers/agentos-ext-credential-vault
9
+ ```
10
+
11
+ Peer dependency: `@framers/agentos` with range `>=0.10.40`.
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { AgentOS } from '@framers/agentos';
17
+
18
+ const agentos = await AgentOS.create({
19
+ extensionManifest: {
20
+ packs: [
21
+ {
22
+ package: '@framers/agentos-ext-credential-vault',
23
+ options: {
24
+ passphrase: process.env.CREDENTIAL_VAULT_PASSPHRASE,
25
+ },
26
+ },
27
+ ],
28
+ },
29
+ });
30
+ ```
31
+
32
+ ## Configuration
33
+
34
+ | Option | Secret id | Environment variable | Required | Default |
35
+ | --- | --- | --- | --- | --- |
36
+ | `passphrase` | `credential-vault.passphrase` | `CREDENTIAL_VAULT_PASSPHRASE` | No | `agentos-default-vault-passphrase` |
37
+ | `secrets` | None | None | No | Context `secrets`, then `{}` |
38
+
39
+ Passphrase resolution checks `options.passphrase`, the selected secrets map's `credential-vault.passphrase`, and `CREDENTIAL_VAULT_PASSPHRASE`, then uses the default. `options.secrets` takes precedence over context `secrets`; the maps are not merged. Resolution uses nullish coalescing, so an empty string passphrase is accepted.
40
+
41
+ ## Tools
42
+
43
+ | Tool | What it does |
44
+ | --- | --- |
45
+ | `credentialsSet` | Stores an encrypted credential scoped by platform and key. |
46
+ | `credentialsGet` | Retrieves a decrypted credential by platform and key. |
47
+ | `credentialsList` | Lists credentials with masked values, optionally filtered by platform. |
48
+ | `credentialsRotate` | Replaces an existing credential's value and returns a rotation timestamp. |
49
+ | `credentialsImport` | Imports credentials from JSON or CSV data into the encrypted vault. |
50
+
51
+ ### `credentialsSet`
52
+
53
+ | Parameter | Type | Required | Description |
54
+ | --- | --- | --- | --- |
55
+ | `platform` | `string` | Yes | Platform or service name (e.g., "twitter", "openai", "github") |
56
+ | `key` | `string` | Yes | Credential key (e.g., `apiKey`, `accessToken`, `password`) |
57
+ | `value` | `string` | Yes | Credential value to encrypt and store |
58
+
59
+ ### `credentialsGet`
60
+
61
+ | Parameter | Type | Required | Description |
62
+ | --- | --- | --- | --- |
63
+ | `platform` | `string` | Yes | Platform or service name (e.g., "twitter", "openai") |
64
+ | `key` | `string` | Yes | Credential key (e.g., `apiKey`, `accessToken`) |
65
+
66
+ ### `credentialsList`
67
+
68
+ | Parameter | Type | Required | Description |
69
+ | --- | --- | --- | --- |
70
+ | `platform` | `string` | No | Optional platform filter to list credentials for a specific service |
71
+
72
+ ### `credentialsRotate`
73
+
74
+ | Parameter | Type | Required | Description |
75
+ | --- | --- | --- | --- |
76
+ | `platform` | `string` | Yes | Platform or service name |
77
+ | `key` | `string` | Yes | Credential key to rotate |
78
+ | `refreshToken` | `string` | Yes | New credential value or refresh token |
79
+
80
+ ### `credentialsImport`
81
+
82
+ | Parameter | Type | Required | Description |
83
+ | --- | --- | --- | --- |
84
+ | `data` | `string` | Yes | Credential data as JSON array (e.g., `[{"platform":"x","key":"apiKey","value":"sk-..."}]`) or CSV (`platform,key,value` per line) |
85
+ | `format` | `string`, enum: `json`, `csv` | No | Data format (default: `json`) |
86
+
87
+ ## Notes
88
+
89
+ - Activation initializes the vault. Before activation and after deactivation, tools return `success: false` with "CredentialVaultService not initialized". Deactivation clears stored credentials.
90
+ - The passphrase derives the encryption key through `scryptSync` with the fixed salt `agentos-credential-vault-salt`. Each stored value uses a random initialization vector. Missing passphrase configuration uses the default shown above.
91
+ - Setting or importing an existing platform and key overwrites its value, preserves `createdAt`, and updates `updatedAt`.
92
+ - `credentialsGet` returns the plaintext value in `data.value`. A missing credential returns `success: false`. Listing returns masked values and timestamps sorted by platform and key; masked values can reveal a prefix.
93
+ - `credentialsRotate` requires an existing credential and stores `refreshToken` as its new value. It returns `rotatedAt` in its result but does not write that timestamp to the stored entry. It makes no external token refresh request.
94
+ - JSON import accepts an array or an object with `platform`, `key`, and `value`. Entries with missing or empty fields are skipped and reported as errors.
95
+ - CSV import reads `platform`, `key`, and `value` from each line, trims those values, ignores blank lines, and skips the first nonblank line if it contains "platform", ignoring case. Its line parser handles quoted commas and escaped double quotes.
96
+ - Import results report `imported`, `skipped`, and any `errors`. Parse errors and skipped entries can appear in a result with `success: true`.
97
+ - The exported `CredentialVaultService` also exposes `deleteCredential` and `exportCredentials`. Export returns plaintext values. The pack registers no delete or export tool.
98
+
99
+ ## License
100
+
101
+ Apache-2.0
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
3
3
  "id": "com.framers.system.credential-vault",
4
4
  "name": "Credential Vault Extension",
5
- "version": "0.1.1",
5
+ "version": "0.1.3",
6
6
  "description": "Encrypted in-memory credential storage with AES-256-GCM encryption, OAuth token rotation, and credential import/export.",
7
7
  "categories": ["system", "security"],
8
8
  "extensions": [
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@framers/agentos-ext-credential-vault",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Credential vault extension for AgentOS — encrypted in-memory credential storage with AES-256-GCM, rotation support, and import/export.",
5
+ "license": "Apache-2.0",
5
6
  "main": "dist/index.js",
6
7
  "types": "dist/index.d.ts",
7
8
  "files": [
@@ -15,7 +16,7 @@
15
16
  "@types/node": "^20.0.0",
16
17
  "typescript": "^5.0.0",
17
18
  "vitest": "^3.2.7",
18
- "@framers/agentos": "^0.10.40"
19
+ "@framers/agentos": "^0.13.47"
19
20
  },
20
21
  "repository": {
21
22
  "type": "git",