@ravi-hq/ravi 0.6.3 → 0.7.1
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 +14 -9
- package/dist/auth.d.ts +31 -28
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +28 -51
- package/dist/auth.js.map +1 -1
- package/dist/bin/ravi-secrets.d.ts +1 -2
- package/dist/bin/ravi-secrets.d.ts.map +1 -1
- package/dist/bin/ravi-secrets.js +7 -34
- package/dist/bin/ravi-secrets.js.map +1 -1
- package/dist/channels/email-trusted.d.ts +2 -0
- package/dist/channels/email-trusted.d.ts.map +1 -1
- package/dist/channels/email-trusted.js +18 -51
- package/dist/channels/email-trusted.js.map +1 -1
- package/dist/channels/email.d.ts +2 -0
- package/dist/channels/email.d.ts.map +1 -1
- package/dist/channels/email.js +18 -60
- package/dist/channels/email.js.map +1 -1
- package/dist/cli.d.ts +13 -6
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +65 -382
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +13 -28
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +22 -63
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/index.d.ts +17 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +156 -45
- package/dist/index.js.map +1 -1
- package/dist/polling.d.ts +2 -12
- package/dist/polling.d.ts.map +1 -1
- package/dist/polling.js +2 -36
- package/dist/polling.js.map +1 -1
- package/dist/tools/identity.d.ts +0 -7
- package/dist/tools/identity.d.ts.map +1 -1
- package/dist/tools/identity.js.map +1 -1
- package/dist/tools/passwords.d.ts +1 -7
- package/dist/tools/passwords.d.ts.map +1 -1
- package/dist/tools/passwords.js +18 -58
- package/dist/tools/passwords.js.map +1 -1
- package/dist/tools/secrets.d.ts +1 -3
- package/dist/tools/secrets.d.ts.map +1 -1
- package/dist/tools/secrets.js +11 -37
- package/dist/tools/secrets.js.map +1 -1
- package/dist/types.d.ts +85 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -2
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +0 -6
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +0 -18
- package/dist/utils.js.map +1 -1
- package/openclaw.plugin.json +1 -0
- package/package.json +1 -5
- package/dist/crypto.d.ts +0 -156
- package/dist/crypto.d.ts.map +0 -1
- package/dist/crypto.js +0 -350
- package/dist/crypto.js.map +0 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ encrypted secrets store through a single plugin.
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
12
|
- **2 messaging channels** -- real-time email via cursor-based polling (owner, trusted)
|
|
13
|
-
- **
|
|
13
|
+
- **29 agent tools** -- manage identities, inboxes, passwords, secrets, contacts, and more
|
|
14
14
|
- **E2E encryption** -- PIN-based Argon2id + NaCl SealedBox, compatible with Ravi CLI
|
|
15
15
|
- **DM policy controls** -- allowlist or open policy per channel account
|
|
16
16
|
- **Lazy crypto** -- encryption keys derived on first use, not at startup
|
|
@@ -30,7 +30,7 @@ openclaw ravi onboard
|
|
|
30
30
|
|
|
31
31
|
`onboard` authenticates (device-code flow + E2E encryption PIN), selects an
|
|
32
32
|
identity, auto-configures OpenClaw, and sets up the `ravi-secrets` provider.
|
|
33
|
-
Credentials are stored in `~/.ravi/
|
|
33
|
+
Credentials are stored in `~/.ravi/config.json` and `identityUuid` is set via
|
|
34
34
|
`openclaw config set`. No manual config editing needed.
|
|
35
35
|
|
|
36
36
|
The auth flow matches the Ravi Go CLI exactly:
|
|
@@ -43,7 +43,7 @@ Use `openclaw ravi login` to re-authenticate without changing identity or config
|
|
|
43
43
|
|
|
44
44
|
## Configuration
|
|
45
45
|
|
|
46
|
-
Authentication is stored in `~/.ravi/
|
|
46
|
+
Authentication is stored in `~/.ravi/config.json` (written by `openclaw ravi login` or `onboard`).
|
|
47
47
|
The `identityUuid` is set automatically by `openclaw ravi onboard` via `openclaw config set`.
|
|
48
48
|
|
|
49
49
|
Manual plugin config is only needed for multi-agent setups where different agents
|
|
@@ -90,7 +90,7 @@ Real-time email channel powered by cursor-based polling from the Ravi backend.
|
|
|
90
90
|
|
|
91
91
|
## Agent Tools
|
|
92
92
|
|
|
93
|
-
The plugin registers
|
|
93
|
+
The plugin registers 29 tools that agents can invoke.
|
|
94
94
|
|
|
95
95
|
### Identity
|
|
96
96
|
|
|
@@ -164,6 +164,7 @@ Run these via `openclaw ravi <command>`:
|
|
|
164
164
|
| `login` | Authenticate via device-code flow and set up E2E encryption PIN |
|
|
165
165
|
| `onboard` | Full setup: auth + identity selection + OpenClaw config + secrets provider |
|
|
166
166
|
| `status` | Show auth status and list available identities |
|
|
167
|
+
| `create-agent-key <uuid> [label]` | Create an identity key for a sub-agent (requires management key) |
|
|
167
168
|
|
|
168
169
|
## E2E Encryption
|
|
169
170
|
|
|
@@ -177,7 +178,7 @@ end-to-end using a 6-digit PIN.
|
|
|
177
178
|
- **Returning login:** Enter PIN (3 attempts), verify against server verifier + public key match
|
|
178
179
|
- **Recovery key:** Saved to `~/.ravi/recovery-key.txt` during first-time setup
|
|
179
180
|
|
|
180
|
-
After login, the derived keypair is stored in `~/.ravi/
|
|
181
|
+
After login, the derived keypair is stored in `~/.ravi/config.json`. Subsequent operations
|
|
181
182
|
use the stored keypair directly — no PIN re-entry needed.
|
|
182
183
|
|
|
183
184
|
## Secrets Provider
|
|
@@ -207,7 +208,7 @@ Then reference secrets anywhere a secret is accepted:
|
|
|
207
208
|
### Requirements
|
|
208
209
|
|
|
209
210
|
- You must run `openclaw ravi onboard` (or `login`) first -- the binary reads
|
|
210
|
-
credentials from `~/.ravi/
|
|
211
|
+
credentials from `~/.ravi/config.json`.
|
|
211
212
|
- Secrets are decrypted automatically using the E2E keypair stored
|
|
212
213
|
during login. If no keypair is found, raw (encrypted) values are returned.
|
|
213
214
|
|
|
@@ -220,7 +221,7 @@ Agent (OpenClaw runtime)
|
|
|
220
221
|
| '-- Polling --> GET /api/email-messages/?direction=incoming&created_after=...
|
|
221
222
|
| Events arrive in plaintext (server decrypts before dispatch)
|
|
222
223
|
|
|
|
223
|
-
+-- Tools (
|
|
224
|
+
+-- Tools (29 agent tools)
|
|
224
225
|
| '-- REST calls --> GET/POST/DELETE /api/...
|
|
225
226
|
| Identity-scoped via bound JWT claims (identity_uuid in token)
|
|
226
227
|
| Returns MCP-style content arrays
|
|
@@ -285,9 +286,13 @@ src/
|
|
|
285
286
|
types.ts # TypeScript interfaces for API responses and polling events
|
|
286
287
|
client.ts # RaviClient -- typed HTTP client for all REST endpoints
|
|
287
288
|
polling.ts # RaviPollingClient -- cursor-based polling for email events
|
|
288
|
-
crypto.ts # E2E encryption (Argon2id + NaCl SealedBox)
|
|
289
289
|
polling-pool.ts # Polling connection pool (ref-counted, one client per identity)
|
|
290
|
-
|
|
290
|
+
auth.ts # Auth persistence (loadConfig, saveConfig, resolveApiKey)
|
|
291
|
+
config.ts # Build-time API URL configuration
|
|
292
|
+
utils.ts # Shared utilities (tryDecrypt, wrapInHtml)
|
|
293
|
+
runtime.ts # PluginRuntime singleton for channel gateway adapters
|
|
294
|
+
attachments.ts # Email attachment validation helpers
|
|
295
|
+
cli.ts # CLI commands (login, onboard, status, create-agent-key)
|
|
291
296
|
bin/
|
|
292
297
|
ravi-secrets.ts # OpenClaw exec secrets provider binary
|
|
293
298
|
channels/
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auth and config persistence for the Ravi plugin.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* All keys and identity config live in a single file: ~/.ravi/config.json
|
|
5
|
+
* Per-directory .ravi/config.json can override the global file.
|
|
6
6
|
*
|
|
7
7
|
* @module auth
|
|
8
8
|
*/
|
|
9
|
-
/**
|
|
10
|
-
export interface
|
|
11
|
-
|
|
12
|
-
refresh_token: string;
|
|
13
|
-
expires_at?: string;
|
|
9
|
+
/** Ravi config — all keys and identity info in one file. */
|
|
10
|
+
export interface RaviConfig {
|
|
11
|
+
management_key?: string;
|
|
14
12
|
user_email?: string;
|
|
15
|
-
|
|
16
|
-
public_key?: string;
|
|
17
|
-
private_key?: string;
|
|
18
|
-
bound_access_token?: string;
|
|
19
|
-
bound_refresh_token?: string;
|
|
20
|
-
}
|
|
21
|
-
/** Identity config matching the Go CLI's Config struct. */
|
|
22
|
-
export interface IdentityConfig {
|
|
13
|
+
identity_key?: string;
|
|
23
14
|
identity_uuid?: string;
|
|
24
15
|
identity_name?: string;
|
|
25
16
|
}
|
|
26
17
|
/** Returns the global config directory (~/.ravi/). */
|
|
27
18
|
export declare function configDir(): string;
|
|
28
|
-
/** Load
|
|
29
|
-
export declare function
|
|
30
|
-
/** Save
|
|
31
|
-
export declare function
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
19
|
+
/** Load config from ~/.ravi/config.json. Returns null if file doesn't exist. */
|
|
20
|
+
export declare function loadConfig(): RaviConfig | null;
|
|
21
|
+
/** Save config to ~/.ravi/config.json with 0600 permissions. */
|
|
22
|
+
export declare function saveConfig(cfg: RaviConfig): void;
|
|
23
|
+
/** Prefix for management API keys. */
|
|
24
|
+
export declare const MGMT_KEY_PREFIX = "ravi_mgmt_";
|
|
25
|
+
/** Prefix for identity-scoped API keys. */
|
|
26
|
+
export declare const IDENTITY_KEY_PREFIX = "ravi_id_";
|
|
27
|
+
/**
|
|
28
|
+
* Resolve the API key to use for Ravi API calls.
|
|
29
|
+
*
|
|
30
|
+
* Priority:
|
|
31
|
+
* 1. pluginConfig.identityKey (per-agent, from OpenClaw config)
|
|
32
|
+
* 2. file identity_key (global ~/.ravi/config.json)
|
|
33
|
+
* 3. file management_key (main agent fallback)
|
|
34
|
+
*
|
|
35
|
+
* Call without arguments for file-only resolution (e.g. ravi-secrets binary).
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveApiKey(pluginConfig?: {
|
|
38
|
+
identityKey?: string;
|
|
39
|
+
}): string | null;
|
|
40
|
+
export type AuthConfig = RaviConfig;
|
|
41
|
+
export type IdentityConfig = RaviConfig;
|
|
42
|
+
export declare const loadAuth: typeof loadConfig;
|
|
43
|
+
export declare const saveAuth: typeof saveConfig;
|
|
41
44
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,4DAA4D;AAC5D,MAAM,WAAW,UAAU;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,sDAAsD;AACtD,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAOD,gFAAgF;AAChF,wBAAgB,UAAU,IAAI,UAAU,GAAG,IAAI,CAiB9C;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAIhD;AAID,sCAAsC;AACtC,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,2CAA2C;AAC3C,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAI9C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,YAAY,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CAIpF;AAGD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC;AACpC,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC;AACxC,eAAO,MAAM,QAAQ,mBAAa,CAAC;AACnC,eAAO,MAAM,QAAQ,mBAAa,CAAC"}
|
package/dist/auth.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auth and config persistence for the Ravi plugin.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* All keys and identity config live in a single file: ~/.ravi/config.json
|
|
5
|
+
* Per-directory .ravi/config.json can override the global file.
|
|
6
6
|
*
|
|
7
7
|
* @module auth
|
|
8
8
|
*/
|
|
@@ -10,9 +10,7 @@ import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
import { homedir } from "node:os";
|
|
12
12
|
const CONFIG_DIR_NAME = ".ravi";
|
|
13
|
-
const AUTH_FILE_NAME = "auth.json";
|
|
14
13
|
const CONFIG_FILE_NAME = "config.json";
|
|
15
|
-
const RECOVERY_KEY_FILE_NAME = "recovery-key.txt";
|
|
16
14
|
const DIR_PERM = 0o700;
|
|
17
15
|
const FILE_PERM = 0o600;
|
|
18
16
|
/** Returns the global config directory (~/.ravi/). */
|
|
@@ -23,44 +21,7 @@ export function configDir() {
|
|
|
23
21
|
function ensureDir() {
|
|
24
22
|
mkdirSync(configDir(), { recursive: true, mode: DIR_PERM });
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
/** Load auth config from ~/.ravi/auth.json. Returns null if file doesn't exist. */
|
|
28
|
-
export function loadAuth() {
|
|
29
|
-
const filePath = join(configDir(), AUTH_FILE_NAME);
|
|
30
|
-
let data;
|
|
31
|
-
try {
|
|
32
|
-
data = readFileSync(filePath, "utf-8");
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
if (err.code === "ENOENT")
|
|
36
|
-
return null;
|
|
37
|
-
throw err;
|
|
38
|
-
}
|
|
39
|
-
try {
|
|
40
|
-
return JSON.parse(data);
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
throw new Error(`Failed to parse ${filePath}: file may be corrupted. ` +
|
|
44
|
-
`Delete it and run 'openclaw ravi login' to re-authenticate.`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/** Save auth config to ~/.ravi/auth.json with 0600 permissions. */
|
|
48
|
-
export function saveAuth(cfg) {
|
|
49
|
-
ensureDir();
|
|
50
|
-
const data = JSON.stringify(cfg, null, 2) + "\n";
|
|
51
|
-
writeFileSync(join(configDir(), AUTH_FILE_NAME), data, { mode: FILE_PERM });
|
|
52
|
-
}
|
|
53
|
-
/** Update specific fields in auth.json without overwriting the rest.
|
|
54
|
-
* Not safe for concurrent callers — serialize externally (e.g. via RaviClient's refreshPromise). */
|
|
55
|
-
export function updateAuth(updates) {
|
|
56
|
-
const existing = loadAuth();
|
|
57
|
-
if (!existing) {
|
|
58
|
-
throw new Error("Cannot update auth: ~/.ravi/auth.json not found. Run 'openclaw ravi login' first.");
|
|
59
|
-
}
|
|
60
|
-
saveAuth({ ...existing, ...updates });
|
|
61
|
-
}
|
|
62
|
-
// ─── Config (identity selector) ───────────────────────────────────────────────
|
|
63
|
-
/** Load identity config from ~/.ravi/config.json. Returns null if file doesn't exist. */
|
|
24
|
+
/** Load config from ~/.ravi/config.json. Returns null if file doesn't exist. */
|
|
64
25
|
export function loadConfig() {
|
|
65
26
|
const filePath = join(configDir(), CONFIG_FILE_NAME);
|
|
66
27
|
let data;
|
|
@@ -77,21 +38,37 @@ export function loadConfig() {
|
|
|
77
38
|
}
|
|
78
39
|
catch {
|
|
79
40
|
throw new Error(`Failed to parse ${filePath}: file may be corrupted. ` +
|
|
80
|
-
`Delete it and run 'openclaw ravi login' to
|
|
41
|
+
`Delete it and run 'openclaw ravi login' to re-authenticate.`);
|
|
81
42
|
}
|
|
82
43
|
}
|
|
83
|
-
/** Save
|
|
44
|
+
/** Save config to ~/.ravi/config.json with 0600 permissions. */
|
|
84
45
|
export function saveConfig(cfg) {
|
|
85
46
|
ensureDir();
|
|
86
47
|
const data = JSON.stringify(cfg, null, 2) + "\n";
|
|
87
48
|
writeFileSync(join(configDir(), CONFIG_FILE_NAME), data, { mode: FILE_PERM });
|
|
88
49
|
}
|
|
89
|
-
// ───
|
|
90
|
-
/**
|
|
91
|
-
export
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
50
|
+
// ─── Key Prefix Constants ───────────────────────────────────────────────────
|
|
51
|
+
/** Prefix for management API keys. */
|
|
52
|
+
export const MGMT_KEY_PREFIX = "ravi_mgmt_";
|
|
53
|
+
/** Prefix for identity-scoped API keys. */
|
|
54
|
+
export const IDENTITY_KEY_PREFIX = "ravi_id_";
|
|
55
|
+
// ─── Centralized Key Resolution ─────────────────────────────────────────────
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the API key to use for Ravi API calls.
|
|
58
|
+
*
|
|
59
|
+
* Priority:
|
|
60
|
+
* 1. pluginConfig.identityKey (per-agent, from OpenClaw config)
|
|
61
|
+
* 2. file identity_key (global ~/.ravi/config.json)
|
|
62
|
+
* 3. file management_key (main agent fallback)
|
|
63
|
+
*
|
|
64
|
+
* Call without arguments for file-only resolution (e.g. ravi-secrets binary).
|
|
65
|
+
*/
|
|
66
|
+
export function resolveApiKey(pluginConfig) {
|
|
67
|
+
if (pluginConfig?.identityKey)
|
|
68
|
+
return pluginConfig.identityKey;
|
|
69
|
+
const config = loadConfig();
|
|
70
|
+
return config?.identity_key || config?.management_key || null;
|
|
96
71
|
}
|
|
72
|
+
export const loadAuth = loadConfig;
|
|
73
|
+
export const saveAuth = saveConfig;
|
|
97
74
|
//# sourceMappingURL=auth.js.map
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,E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AAC,KAAK,CAAC,IAAI,CAAe,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,mBAAmB,QAAQ,2BAA2B;YACpD,6DAA6D,CAChE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,UAAU,CAAC,GAAe;IACxC,SAAS,EAAE,CAAC;IACZ,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IACjD,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,+EAA+E;AAE/E,sCAAsC;AACtC,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;AAE5C,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE9C,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,YAAuC;IACnE,IAAI,YAAY,EAAE,WAAW;QAAE,OAAO,YAAY,CAAC,WAAW,CAAC;IAC/D,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO,MAAM,EAAE,YAAY,IAAI,MAAM,EAAE,cAAc,IAAI,IAAI,CAAC;AAChE,CAAC;AAKD,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AACnC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC"}
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* stdin: { "protocolVersion": 1, "provider": "ravi", "ids": ["key1", "key2"] }
|
|
7
7
|
* stdout: { "protocolVersion": 1, "values": { "key1": "val1", "key2": "val2" } }
|
|
8
8
|
*
|
|
9
|
-
* Reads auth credentials from ~/.ravi/
|
|
10
|
-
* Decrypts secrets using the stored E2E keypair.
|
|
9
|
+
* Reads auth credentials from ~/.ravi/config.json (written by `openclaw ravi onboard`).
|
|
11
10
|
*
|
|
12
11
|
* Usage in OpenClaw config:
|
|
13
12
|
* secrets:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ravi-secrets.d.ts","sourceRoot":"","sources":["../../src/bin/ravi-secrets.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"ravi-secrets.d.ts","sourceRoot":"","sources":["../../src/bin/ravi-secrets.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG"}
|
package/dist/bin/ravi-secrets.js
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* stdin: { "protocolVersion": 1, "provider": "ravi", "ids": ["key1", "key2"] }
|
|
7
7
|
* stdout: { "protocolVersion": 1, "values": { "key1": "val1", "key2": "val2" } }
|
|
8
8
|
*
|
|
9
|
-
* Reads auth credentials from ~/.ravi/
|
|
10
|
-
* Decrypts secrets using the stored E2E keypair.
|
|
9
|
+
* Reads auth credentials from ~/.ravi/config.json (written by `openclaw ravi onboard`).
|
|
11
10
|
*
|
|
12
11
|
* Usage in OpenClaw config:
|
|
13
12
|
* secrets:
|
|
@@ -21,8 +20,7 @@
|
|
|
21
20
|
*/
|
|
22
21
|
import { RAVI_API_URL } from "../config.js";
|
|
23
22
|
import { RaviClient } from "../client.js";
|
|
24
|
-
import {
|
|
25
|
-
import { loadAuth } from "../auth.js";
|
|
23
|
+
import { resolveApiKey } from "../auth.js";
|
|
26
24
|
async function main() {
|
|
27
25
|
// Read JSON request from stdin
|
|
28
26
|
const chunks = [];
|
|
@@ -50,45 +48,20 @@ async function main() {
|
|
|
50
48
|
writeResponse({ protocolVersion: 1, values: {} });
|
|
51
49
|
return;
|
|
52
50
|
}
|
|
53
|
-
// Load
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
51
|
+
// Load API key from file config (no pluginConfig in standalone binary)
|
|
52
|
+
const apiKey = resolveApiKey();
|
|
53
|
+
if (!apiKey) {
|
|
56
54
|
writeError("Not authenticated. Run 'openclaw ravi onboard' first.");
|
|
57
55
|
return;
|
|
58
56
|
}
|
|
59
|
-
|
|
60
|
-
const client = new RaviClient({
|
|
61
|
-
apiUrl: RAVI_API_URL,
|
|
62
|
-
token: auth.bound_access_token || auth.access_token,
|
|
63
|
-
refreshToken: auth.bound_refresh_token || auth.refresh_token,
|
|
64
|
-
});
|
|
65
|
-
// Create crypto manager for decryption
|
|
66
|
-
let decrypt;
|
|
67
|
-
if (auth.public_key && auth.private_key) {
|
|
68
|
-
try {
|
|
69
|
-
const crypto = createCryptoManagerFromKeyPair(auth.public_key, auth.private_key);
|
|
70
|
-
decrypt = (value) => crypto.decrypt(value);
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
// Continue without decryption — return raw (encrypted) values
|
|
74
|
-
}
|
|
75
|
-
}
|
|
57
|
+
const client = new RaviClient({ apiUrl: RAVI_API_URL, apiKey });
|
|
76
58
|
// Fetch each requested secret
|
|
77
59
|
const values = {};
|
|
78
60
|
const errors = {};
|
|
79
61
|
await Promise.all(request.ids.map(async (key) => {
|
|
80
62
|
try {
|
|
81
63
|
const secret = await client.getSecret(key);
|
|
82
|
-
|
|
83
|
-
if (decrypt && value) {
|
|
84
|
-
try {
|
|
85
|
-
value = await decrypt(value);
|
|
86
|
-
}
|
|
87
|
-
catch {
|
|
88
|
-
// Return raw value if decryption fails
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
values[key] = value;
|
|
64
|
+
values[key] = secret.value;
|
|
92
65
|
}
|
|
93
66
|
catch (err) {
|
|
94
67
|
errors[key] = err instanceof Error ? err.message : String(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ravi-secrets.js","sourceRoot":"","sources":["../../src/bin/ravi-secrets.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"ravi-secrets.js","sourceRoot":"","sources":["../../src/bin/ravi-secrets.ts"],"names":[],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AE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,UAAU,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -7,6 +7,8 @@ export interface EmailTrustedAccountConfig {
|
|
|
7
7
|
identityName: string;
|
|
8
8
|
/** The email address provisioned for this identity. */
|
|
9
9
|
email: string;
|
|
10
|
+
/** Per-agent identity key from OpenClaw plugin config (multi-agent setups). */
|
|
11
|
+
identityKey?: string;
|
|
10
12
|
}
|
|
11
13
|
/** Normalized inbound message envelope produced by {@link normalizeInbound}. */
|
|
12
14
|
export interface EmailTrustedInboundEnvelope {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-trusted.d.ts","sourceRoot":"","sources":["../../src/channels/email-trusted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIlE,sFAAsF;AACtF,MAAM,WAAW,yBAAyB;IACxC,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"email-trusted.d.ts","sourceRoot":"","sources":["../../src/channels/email-trusted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIlE,sFAAsF;AACtF,MAAM,WAAW,yBAAyB;IACxC,kDAAkD;IA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EAAE;QAiBxD;;WAEG;8BAEI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,aACjB,MAAM,KAChB,yBAAyB;;IA0B9B;;;;OAIG;4BAEM,UAAU,WACR,yBAAyB,GACjC,2BAA2B,GAAG,IAAI;IAgBrC;;;;OAIG;2BACoB,MAAM,aAAa,MAAM,YAAY,MAAM,GAAG,MAAM;;QAOzE;;;;;WAKG;4BACuB,0BAA0B,KAAG,OAAO,CAAC,IAAI,CAAC;;CA8JR,CAAC"}
|
|
@@ -41,12 +41,19 @@ export function createEmailTrustedChannel() {
|
|
|
41
41
|
resolveAccount: (cfg, accountId) => {
|
|
42
42
|
const channels = cfg.channels;
|
|
43
43
|
const found = channels?.["ravi-email-trusted"]?.accounts?.[accountId];
|
|
44
|
-
|
|
44
|
+
// Extract per-agent identity key from plugin config (multi-agent setups)
|
|
45
|
+
const plugins = cfg.plugins;
|
|
46
|
+
const pluginIdentityKey = plugins?.entries?.ravi?.config?.identityKey;
|
|
47
|
+
if (found) {
|
|
48
|
+
if (pluginIdentityKey)
|
|
49
|
+
found.identityKey = pluginIdentityKey;
|
|
45
50
|
return found;
|
|
51
|
+
}
|
|
46
52
|
return {
|
|
47
53
|
identityUuid: accountId,
|
|
48
54
|
identityName: "",
|
|
49
55
|
email: "",
|
|
56
|
+
identityKey: pluginIdentityKey,
|
|
50
57
|
};
|
|
51
58
|
},
|
|
52
59
|
},
|
|
@@ -92,10 +99,10 @@ export function createEmailTrustedChannel() {
|
|
|
92
99
|
warn: (...args) => console.warn("[ravi-email-trusted]", ...args),
|
|
93
100
|
error: (...args) => console.error("[ravi-email-trusted]", ...args),
|
|
94
101
|
};
|
|
95
|
-
let getRaviRuntime,
|
|
102
|
+
let getRaviRuntime, resolveApiKey, RAVI_API_URL, RaviClient, acquirePollingClient, releasePollingClient;
|
|
96
103
|
try {
|
|
97
104
|
({ getRaviRuntime } = await import("../runtime.js"));
|
|
98
|
-
({
|
|
105
|
+
({ resolveApiKey } = await import("../auth.js"));
|
|
99
106
|
({ RAVI_API_URL } = await import("../config.js"));
|
|
100
107
|
({ RaviClient } = await import("../client.js"));
|
|
101
108
|
({ acquirePollingClient, releasePollingClient } = await import("../polling-pool.js"));
|
|
@@ -106,29 +113,12 @@ export function createEmailTrustedChannel() {
|
|
|
106
113
|
return;
|
|
107
114
|
}
|
|
108
115
|
const runtime = getRaviRuntime();
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
111
|
-
log.error("[ravi-email-trusted] No
|
|
116
|
+
const apiKey = ctx.account.identityKey || resolveApiKey();
|
|
117
|
+
if (!apiKey) {
|
|
118
|
+
log.error("[ravi-email-trusted] No API key — cannot start email-trusted channel. Run 'openclaw ravi login'.");
|
|
112
119
|
return;
|
|
113
120
|
}
|
|
114
|
-
|
|
115
|
-
let poller = null;
|
|
116
|
-
const client = new RaviClient({
|
|
117
|
-
apiUrl: RAVI_API_URL,
|
|
118
|
-
token: auth.bound_access_token || auth.access_token,
|
|
119
|
-
refreshToken: auth.bound_refresh_token || auth.refresh_token,
|
|
120
|
-
onTokenRefresh: (newToken) => {
|
|
121
|
-
currentToken = newToken;
|
|
122
|
-
try {
|
|
123
|
-
updateAuth({ bound_access_token: newToken });
|
|
124
|
-
}
|
|
125
|
-
catch (err) {
|
|
126
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
127
|
-
log.error(`[ravi-email-trusted] Failed to persist refreshed token: ${detail}`);
|
|
128
|
-
}
|
|
129
|
-
poller?.updateToken(newToken);
|
|
130
|
-
},
|
|
131
|
-
});
|
|
121
|
+
const client = new RaviClient({ apiUrl: RAVI_API_URL, apiKey });
|
|
132
122
|
let email = ctx.account.email;
|
|
133
123
|
let identityName = ctx.account.identityName;
|
|
134
124
|
if (!email) {
|
|
@@ -139,15 +129,8 @@ export function createEmailTrustedChannel() {
|
|
|
139
129
|
identityName = identity?.display_name ?? identity?.name ?? ctx.accountId;
|
|
140
130
|
}
|
|
141
131
|
catch (err) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
log.error(`[ravi-email-trusted] Failed to fetch identity details (HTTP ${status}): ${err.message}` +
|
|
145
|
-
(status === 401 ? ". Token may be expired — run 'openclaw ravi login'." : ""));
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
149
|
-
log.error(`[ravi-email-trusted] Failed to fetch identity details: ${detail}`);
|
|
150
|
-
}
|
|
132
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
133
|
+
log.error(`[ravi-email-trusted] Failed to fetch identity details: ${detail}`);
|
|
151
134
|
return;
|
|
152
135
|
}
|
|
153
136
|
}
|
|
@@ -156,25 +139,9 @@ export function createEmailTrustedChannel() {
|
|
|
156
139
|
return;
|
|
157
140
|
}
|
|
158
141
|
log.info(`[ravi-email-trusted] Starting email-trusted channel for ${identityName} (${email})`);
|
|
159
|
-
poller = acquirePollingClient({
|
|
142
|
+
const poller = acquirePollingClient({
|
|
160
143
|
apiUrl: RAVI_API_URL,
|
|
161
|
-
|
|
162
|
-
onAuthFailure: async () => {
|
|
163
|
-
const tokenBefore = currentToken;
|
|
164
|
-
try {
|
|
165
|
-
await client.listIdentities();
|
|
166
|
-
}
|
|
167
|
-
catch (err) {
|
|
168
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
169
|
-
log.error(`[ravi-email-trusted] Auth refresh failed during polling reconnect: ${detail}. Run 'openclaw ravi login' to re-authenticate.`);
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
172
|
-
if (currentToken === tokenBefore) {
|
|
173
|
-
log.warn(`[ravi-email-trusted] Auth refresh did not produce a new token — polling auth failure is not recoverable via REST refresh`);
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
return currentToken;
|
|
177
|
-
},
|
|
144
|
+
apiKey,
|
|
178
145
|
}, ctx.accountId);
|
|
179
146
|
poller.onEmailTrusted((event) => {
|
|
180
147
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-trusted.js","sourceRoot":"","sources":["../../src/channels/email-trusted.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"email-trusted.js","sourceRoot":"","sources":["../../src/channels/email-trusted.ts"],"names":[],"mappings":"AA0CA,gFAAgF;AAEhF;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,EAAE,EAAE,oBAA6B;QAEjC,IAAI,EAAE;YACJ,EAAE,EAAE,oBAAoB;YACxB,KAAK,EAAE,sBAAsB;YAC7B,cAAc,EAAE,wCAAwC;YACxD,KAAK,EACH,kHAAkH;YACpH,OAAO,EAAE,CAAC,mBAAmB,CAAC;SAC/B;QAED,YAAY,EAAE;YACZ,SAAS,EAAE,CAAC,QAAQ,CAAU;SAC/B;QAED,MAAM,EAAE;YACN;;eAEG;YACH,cAAc,EAAE,CAAC,GAA4B,EAAY,EAAE;gBACzD,MAAM,OAAO,GAAG,GAAG,CAAC,OAEP,CAAC;gBACd,MAAM,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC;gBAE1D,MAAM,QAAQ,GAAG,GAAG,CAAC,QAER,CAAC;gBACd,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,oBAAoB,CAAC,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;gBAEjF,IAAI,IAAI,EAAE,CAAC;oBACT,OAAO,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;gBAC3D,CAAC;gBACD,OAAO,UAAU,CAAC;YACpB,CAAC;YAED;;eAEG;YACH,cAAc,EAAE,CACd,GAA4B,EAC5B,SAAiB,EACU,EAAE;gBAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,QAER,CAAC;gBACd,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC,oBAAoB,CAAC,E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Y,oBAAoB,CAAC,CAAC;wBACtG,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;wBACpC,OAAO,EAAE,CAAC;wBACV,OAAO;oBACT,CAAC;oBACD,GAAG,CAAC,WAAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;wBAC7C,GAAG,CAAC,IAAI,CAAC,2DAA2D,YAAY,EAAE,CAAC,CAAC;wBACpF,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;wBACpC,OAAO,EAAE,CAAC;oBACZ,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED,yDAAyD;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,EAAE,CAAC"}
|
package/dist/channels/email.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface EmailAccountConfig {
|
|
|
8
8
|
identityName: string;
|
|
9
9
|
/** The email address provisioned for this identity. */
|
|
10
10
|
email: string;
|
|
11
|
+
/** Per-agent identity key from OpenClaw plugin config (multi-agent setups). */
|
|
12
|
+
identityKey?: string;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Thread context passed alongside outbound messages so the channel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/channels/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKlE,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/channels/email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