@ravi-hq/ravi 0.5.3 → 0.5.5
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 +62 -68
- package/dist/auth.d.ts +2 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js.map +1 -1
- package/dist/bin/ravi-secrets.d.ts +3 -3
- package/dist/bin/ravi-secrets.js +7 -7
- package/dist/bin/ravi-secrets.js.map +1 -1
- package/dist/channels/email-trusted.d.ts.map +1 -1
- package/dist/channels/email-trusted.js +5 -7
- package/dist/channels/email-trusted.js.map +1 -1
- package/dist/channels/email-untrusted.d.ts.map +1 -1
- package/dist/channels/email-untrusted.js +5 -7
- package/dist/channels/email-untrusted.js.map +1 -1
- package/dist/channels/email.d.ts +12 -22
- package/dist/channels/email.d.ts.map +1 -1
- package/dist/channels/email.js +48 -54
- package/dist/channels/email.js.map +1 -1
- package/dist/cli.d.ts +15 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +271 -211
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +62 -22
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +75 -33
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +7 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -76
- package/dist/index.js.map +1 -1
- package/dist/sse-pool.d.ts +5 -2
- package/dist/sse-pool.d.ts.map +1 -1
- package/dist/sse-pool.js +9 -7
- package/dist/sse-pool.js.map +1 -1
- package/dist/sse.d.ts +7 -21
- package/dist/sse.d.ts.map +1 -1
- package/dist/sse.js +10 -33
- package/dist/sse.js.map +1 -1
- package/dist/tools/contacts.d.ts +14 -0
- package/dist/tools/contacts.d.ts.map +1 -0
- package/dist/tools/contacts.js +186 -0
- package/dist/tools/contacts.js.map +1 -0
- package/dist/tools/email-send.d.ts.map +1 -1
- package/dist/tools/email-send.js +11 -4
- package/dist/tools/email-send.js.map +1 -1
- package/dist/tools/identity.d.ts +2 -2
- package/dist/tools/identity.d.ts.map +1 -1
- package/dist/tools/identity.js +14 -6
- package/dist/tools/identity.js.map +1 -1
- package/dist/tools/inbox.js +7 -7
- package/dist/tools/inbox.js.map +1 -1
- package/dist/tools/passwords.d.ts.map +1 -1
- package/dist/tools/passwords.js +20 -7
- package/dist/tools/passwords.js.map +1 -1
- package/dist/tools/secrets.d.ts +15 -0
- package/dist/tools/secrets.d.ts.map +1 -0
- package/dist/tools/{vault.js → secrets.js} +23 -23
- package/dist/tools/secrets.js.map +1 -0
- package/dist/tools/sms-send.d.ts.map +1 -1
- package/dist/tools/sms-send.js +3 -1
- package/dist/tools/sms-send.js.map +1 -1
- package/dist/types.d.ts +18 -12
- package/dist/types.d.ts.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -13
- package/dist/channels/sms-trusted.d.ts +0 -161
- package/dist/channels/sms-trusted.d.ts.map +0 -1
- package/dist/channels/sms-trusted.js +0 -306
- package/dist/channels/sms-trusted.js.map +0 -1
- package/dist/channels/sms-untrusted.d.ts +0 -124
- package/dist/channels/sms-untrusted.d.ts.map +0 -1
- package/dist/channels/sms-untrusted.js +0 -269
- package/dist/channels/sms-untrusted.js.map +0 -1
- package/dist/channels/sms.d.ts +0 -279
- package/dist/channels/sms.d.ts.map +0 -1
- package/dist/channels/sms.js +0 -385
- package/dist/channels/sms.js.map +0 -1
- package/dist/service.d.ts +0 -107
- package/dist/service.d.ts.map +0 -1
- package/dist/service.js +0 -211
- package/dist/service.js.map +0 -1
- package/dist/tools/vault.d.ts +0 -15
- package/dist/tools/vault.d.ts.map +0 -1
- package/dist/tools/vault.js.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Secret management tools for the Ravi OpenClaw plugin.
|
|
3
3
|
*
|
|
4
4
|
* Provides tools to list, retrieve, and store key-value secrets in the Ravi
|
|
5
|
-
*
|
|
5
|
+
* secrets store. When a {@link CryptoManager} is available in the tool context, values
|
|
6
6
|
* are automatically decrypted on read and encrypted on write using E2E
|
|
7
7
|
* NaCl SealedBox encryption.
|
|
8
8
|
*
|
|
9
|
-
* @module tools/
|
|
9
|
+
* @module tools/secrets
|
|
10
10
|
*/
|
|
11
11
|
import { tryDecrypt } from "../utils.js";
|
|
12
|
-
// ───
|
|
13
|
-
/** Tools for managing secrets in the Ravi
|
|
14
|
-
export const
|
|
12
|
+
// ─── Secrets Tools ──────────────────────────────────────────────────────────
|
|
13
|
+
/** Tools for managing secrets in the Ravi secrets store (list, get, set). */
|
|
14
|
+
export const secretsTools = [
|
|
15
15
|
{
|
|
16
|
-
name: "
|
|
17
|
-
description: "List all secret keys stored in the Ravi
|
|
18
|
-
"values are hidden in list view for security. Use
|
|
16
|
+
name: "ravi_secrets_list",
|
|
17
|
+
description: "List all secret keys stored in the Ravi secrets store. Returns key names and UUIDs — " +
|
|
18
|
+
"values are hidden in list view for security. Use ravi_secrets_get with a specific key to retrieve the value. " +
|
|
19
19
|
"For website credentials (domain + username + password), use ravi_passwords_list instead.",
|
|
20
20
|
parameters: {
|
|
21
21
|
type: "object",
|
|
@@ -27,16 +27,16 @@ export const vaultTools = [
|
|
|
27
27
|
return Promise.all(secrets.map(async (s) => {
|
|
28
28
|
const result = { ...s, value: "[hidden]" };
|
|
29
29
|
if (crypto && s.notes) {
|
|
30
|
-
result.notes = await tryDecrypt(crypto, s.notes, "
|
|
30
|
+
result.notes = await tryDecrypt(crypto, s.notes, "secrets.notes");
|
|
31
31
|
}
|
|
32
32
|
return result;
|
|
33
33
|
}));
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
name: "
|
|
38
|
-
description: "Get a secret from the Ravi
|
|
39
|
-
"Response includes the secret's UUID (needed for
|
|
37
|
+
name: "ravi_secrets_get",
|
|
38
|
+
description: "Get a secret from the Ravi secrets store by key name. The value is automatically decrypted. " +
|
|
39
|
+
"Response includes the secret's UUID (needed for ravi_secrets_delete). " +
|
|
40
40
|
"Use this to retrieve API keys, tokens, or any sensitive configuration values at runtime. " +
|
|
41
41
|
"Keys follow the convention: UPPERCASE_WITH_UNDERSCORES (e.g. OPENAI_API_KEY, STRIPE_SECRET_KEY).",
|
|
42
42
|
parameters: {
|
|
@@ -54,17 +54,17 @@ export const vaultTools = [
|
|
|
54
54
|
const secret = await client.getSecret(params.key);
|
|
55
55
|
if (crypto) {
|
|
56
56
|
if (secret.value)
|
|
57
|
-
secret.value = await tryDecrypt(crypto, secret.value, "
|
|
57
|
+
secret.value = await tryDecrypt(crypto, secret.value, "secrets.value");
|
|
58
58
|
if (secret.notes)
|
|
59
|
-
secret.notes = await tryDecrypt(crypto, secret.notes, "
|
|
59
|
+
secret.notes = await tryDecrypt(crypto, secret.notes, "secrets.notes");
|
|
60
60
|
}
|
|
61
61
|
return secret;
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
name: "
|
|
66
|
-
description: "Store a secret in the Ravi
|
|
67
|
-
"
|
|
65
|
+
name: "ravi_secrets_set",
|
|
66
|
+
description: "Store a secret in the Ravi secrets store. The value is E2E encrypted before being sent to the server. " +
|
|
67
|
+
"Fails if a secret with the same key already exists — use ravi_secrets_delete first, then re-create. " +
|
|
68
68
|
"Use this to store API keys, tokens, or any sensitive configuration values securely. " +
|
|
69
69
|
"Keys must be UPPERCASE_WITH_UNDERSCORES (e.g. OPENAI_API_KEY). " +
|
|
70
70
|
"For website login credentials (domain + username + password), use ravi_passwords_create instead.",
|
|
@@ -102,15 +102,15 @@ export const vaultTools = [
|
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
|
-
name: "
|
|
106
|
-
description: "Delete a secret from the Ravi
|
|
107
|
-
"Use
|
|
105
|
+
name: "ravi_secrets_delete",
|
|
106
|
+
description: "Delete a secret from the Ravi secrets store by UUID. This is permanent and cannot be undone. " +
|
|
107
|
+
"Use ravi_secrets_list or ravi_secrets_get to find the UUID of the secret to delete.",
|
|
108
108
|
parameters: {
|
|
109
109
|
type: "object",
|
|
110
110
|
properties: {
|
|
111
111
|
uuid: {
|
|
112
112
|
type: "string",
|
|
113
|
-
description: "UUID of the
|
|
113
|
+
description: "UUID of the secret to delete (from ravi_secrets_list or ravi_secrets_get)",
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
116
|
required: ["uuid"],
|
|
@@ -121,4 +121,4 @@ export const vaultTools = [
|
|
|
121
121
|
},
|
|
122
122
|
},
|
|
123
123
|
];
|
|
124
|
-
//# sourceMappingURL=
|
|
124
|
+
//# sourceMappingURL=secrets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/tools/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,+EAA+E;AAE/E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,uFAAuF;YACvF,+GAA+G;YAC/G,0FAA0F;QAC5F,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;SACb;QACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;YAC7C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;YAC3C,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;gBACzC,MAAM,MAAM,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,UAAoB,EAAE,CAAC;gBACrD,IAAI,MAAM,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;oBACtB,MAAM,CAAC,KAAK,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,EAA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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms-send.d.ts","sourceRoot":"","sources":["../../src/tools/sms-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAEjE,qCAAqC;AACrC,eAAO,MAAM,YAAY,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"sms-send.d.ts","sourceRoot":"","sources":["../../src/tools/sms-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAEjE,qCAAqC;AACrC,eAAO,MAAM,YAAY,EAAE,cAAc,EA8BxC,CAAC"}
|
package/dist/tools/sms-send.js
CHANGED
|
@@ -10,9 +10,11 @@ export const smsSendTools = [
|
|
|
10
10
|
{
|
|
11
11
|
name: "ravi_sms_send",
|
|
12
12
|
description: "Send an SMS message from the active identity's phone number. " +
|
|
13
|
+
"IMPORTANT: If you only have the recipient's name (e.g. 'text Bob'), use ravi_contacts_search first " +
|
|
14
|
+
"to look up their phone number. If multiple contacts match, confirm with the user before sending. " +
|
|
13
15
|
"The identity must have a provisioned phone number (check with ravi_get_info). " +
|
|
14
16
|
"SMS messages are plain text only, max 1600 characters. " +
|
|
15
|
-
"The sent message will appear in the SMS inbox as an
|
|
17
|
+
"The sent message will appear in the SMS inbox as an outgoing message.",
|
|
16
18
|
parameters: {
|
|
17
19
|
type: "object",
|
|
18
20
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms-send.js","sourceRoot":"","sources":["../../src/tools/sms-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,+DAA+D;YAC/D,gFAAgF;YAChF,yDAAyD;YACzD,uEAAuE;QACzE,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,qEAAqE;wBACrE,sDAAsD;iBACzD;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,oDAAoD;iBAClE;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC;SAChC;QACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACpC,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAmB,EAAE,MAAM,CAAC,IAAc,CAAC,CAAC;QAC3E,CAAC;KACF;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"sms-send.js","sourceRoot":"","sources":["../../src/tools/sms-send.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,+DAA+D;YAC/D,qGAAqG;YACrG,mGAAmG;YACnG,gFAAgF;YAChF,yDAAyD;YACzD,uEAAuE;QACzE,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,qEAAqE;wBACrE,sDAAsD;iBACzD;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,oDAAoD;iBAClE;aACF;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC;SAChC;QACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACpC,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAmB,EAAE,MAAM,CAAC,IAAc,CAAC,CAAC;QAC3E,CAAC;KACF;CACF,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export interface PasswordEntry {
|
|
|
104
104
|
created_dt: string;
|
|
105
105
|
updated_dt: string;
|
|
106
106
|
}
|
|
107
|
-
/**
|
|
107
|
+
/** Secret entry from GET /api/secrets/ */
|
|
108
108
|
export interface SecretEntry {
|
|
109
109
|
uuid: string;
|
|
110
110
|
key: string;
|
|
@@ -115,6 +115,20 @@ export interface SecretEntry {
|
|
|
115
115
|
created_dt: string;
|
|
116
116
|
updated_dt: string;
|
|
117
117
|
}
|
|
118
|
+
/** Contact entry from GET /api/contacts/ */
|
|
119
|
+
export interface ContactEntry {
|
|
120
|
+
uuid: string;
|
|
121
|
+
email: string;
|
|
122
|
+
phone_number: string;
|
|
123
|
+
display_name: string;
|
|
124
|
+
nickname: string;
|
|
125
|
+
is_trusted: boolean;
|
|
126
|
+
source: "auto" | "manual";
|
|
127
|
+
interaction_count: number;
|
|
128
|
+
last_interaction_dt: string | null;
|
|
129
|
+
created_dt: string;
|
|
130
|
+
updated_dt: string;
|
|
131
|
+
}
|
|
118
132
|
/** Encryption metadata from GET /api/encryption/ */
|
|
119
133
|
export interface EncryptionMeta {
|
|
120
134
|
id: number;
|
|
@@ -141,14 +155,6 @@ export interface EmailEvent {
|
|
|
141
155
|
attachments: number;
|
|
142
156
|
in_reply_to: string | null;
|
|
143
157
|
}
|
|
144
|
-
/** Real-time SMS event from the SSE stream */
|
|
145
|
-
export interface SmsEvent {
|
|
146
|
-
id: string;
|
|
147
|
-
from_number: string;
|
|
148
|
-
body: string;
|
|
149
|
-
conversation_id: string;
|
|
150
|
-
created_dt: string;
|
|
151
|
-
}
|
|
152
158
|
/** Structured logger available to gateway adapters. */
|
|
153
159
|
export interface GatewayLogger {
|
|
154
160
|
info: (...args: unknown[]) => void;
|
|
@@ -194,7 +200,7 @@ export interface PluginRuntimeSubset {
|
|
|
194
200
|
*
|
|
195
201
|
* Passed by the ChannelManager to `gateway.startAccount()`. The generic
|
|
196
202
|
* parameter `TAccount` is the channel-specific account config type
|
|
197
|
-
* (e.g. {@link EmailAccountConfig}
|
|
203
|
+
* (e.g. {@link EmailAccountConfig}).
|
|
198
204
|
*/
|
|
199
205
|
export interface BaseGatewayContext<TAccount> {
|
|
200
206
|
/** Full OpenClaw gateway configuration. */
|
|
@@ -212,13 +218,13 @@ export interface BaseGatewayContext<TAccount> {
|
|
|
212
218
|
* Configuration shape for the Ravi OpenClaw plugin.
|
|
213
219
|
*
|
|
214
220
|
* Auth credentials (tokens, keypair) are stored in ~/.ravi/auth.json
|
|
215
|
-
* (managed by `openclaw ravi
|
|
221
|
+
* (managed by `openclaw ravi onboard`). The OpenClaw config only needs
|
|
216
222
|
* the identity UUID to scope this agent to a specific Ravi identity.
|
|
217
223
|
*/
|
|
218
224
|
export interface RaviPluginConfig {
|
|
219
225
|
/** Identity UUID — maps this OpenClaw agent to a Ravi identity.
|
|
220
226
|
* Set in the OpenClaw agent config (each agent binds to one identity).
|
|
221
|
-
* Optional at install time; set automatically by `openclaw ravi
|
|
227
|
+
* Optional at install time; set automatically by `openclaw ravi onboard`. */
|
|
222
228
|
identityUuid?: string;
|
|
223
229
|
/** When false, emails from unknown senders are silently dropped. Defaults to true. */
|
|
224
230
|
externalEmail?: boolean;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAMA,yCAAyC;AACzC,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,8CAA8C;AAC9C,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,OAAO,EA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QAAQ;IAC1C,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,OAAO,EAAE,QAAQ,CAAC;IAClB,qEAAqE;IACrE,WAAW,EAAE,WAAW,CAAC;IACzB,gEAAgE;IAChE,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAID;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;kFAE8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "ravi",
|
|
3
3
|
"name": "Ravi",
|
|
4
|
-
"description": "Identity provider for AI agents — email, phone, passwords,
|
|
4
|
+
"description": "Identity provider for AI agents — email, phone, passwords, secrets, and more.",
|
|
5
5
|
"configSchema": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ravi-hq/ravi",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "OpenClaw plugin for Ravi — identity provider for AI agents. Email
|
|
3
|
+
"version": "0.5.5",
|
|
4
|
+
"description": "OpenClaw plugin for Ravi — identity provider for AI agents. Email channels + full agent toolbox.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -21,23 +21,14 @@
|
|
|
21
21
|
],
|
|
22
22
|
"channels": [
|
|
23
23
|
{
|
|
24
|
-
"id": "ravi-email",
|
|
24
|
+
"id": "ravi-email-owner",
|
|
25
25
|
"label": "Ravi Email",
|
|
26
|
-
"docsPath": "/channels/ravi-email",
|
|
26
|
+
"docsPath": "/channels/ravi-email-owner",
|
|
27
27
|
"blurb": "Email channel for AI agents via Ravi identity provider",
|
|
28
28
|
"aliases": [
|
|
29
29
|
"ravi-mail",
|
|
30
30
|
"ravi"
|
|
31
31
|
]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "ravi-sms",
|
|
35
|
-
"label": "Ravi SMS",
|
|
36
|
-
"docsPath": "/channels/ravi-sms",
|
|
37
|
-
"blurb": "SMS channel for AI agents via Ravi identity provider",
|
|
38
|
-
"aliases": [
|
|
39
|
-
"ravi-text"
|
|
40
|
-
]
|
|
41
32
|
}
|
|
42
33
|
]
|
|
43
34
|
},
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import type { RaviClient } from "../client.js";
|
|
2
|
-
import type { SmsEvent, BaseGatewayContext } from "../types.js";
|
|
3
|
-
/** Configuration for a single SMS account within the ravi-sms-trusted channel. */
|
|
4
|
-
export interface SmsTrustedAccountConfig {
|
|
5
|
-
/** The identity UUID this account is bound to. */
|
|
6
|
-
identityUuid: string;
|
|
7
|
-
/** Human-readable identity name for display purposes. */
|
|
8
|
-
identityName: string;
|
|
9
|
-
/** The phone number provisioned for this identity (E.164 format). */
|
|
10
|
-
phone: string;
|
|
11
|
-
}
|
|
12
|
-
/** Normalized inbound message envelope produced by {@link normalizeInbound}. */
|
|
13
|
-
export interface SmsTrustedInboundEnvelope {
|
|
14
|
-
/** Sender's phone number (used as the sender ID). */
|
|
15
|
-
senderId: string;
|
|
16
|
-
/** Plain-text body of the SMS message. */
|
|
17
|
-
text: string;
|
|
18
|
-
/** Phone number that maps to the OpenClaw session key. */
|
|
19
|
-
threadId: string;
|
|
20
|
-
/** Additional SMS metadata passed through to the agent. */
|
|
21
|
-
metadata: {
|
|
22
|
-
conversationId: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/** Context passed by the ChannelManager to `gateway.startAccount()`. */
|
|
26
|
-
export type SmsTrustedGatewayContext = BaseGatewayContext<SmsTrustedAccountConfig>;
|
|
27
|
-
/**
|
|
28
|
-
* Creates the ravi-sms-trusted channel definition for OpenClaw.
|
|
29
|
-
*
|
|
30
|
-
* Notification-only channel for SMS from trusted senders (the identity owner's
|
|
31
|
-
* other phone numbers or known contacts). The agent processes the message as an
|
|
32
|
-
* instruction. Delivery calls sendSms — the agent can reply directly.
|
|
33
|
-
*
|
|
34
|
-
* @returns The ravi-sms-trusted channel definition object.
|
|
35
|
-
*/
|
|
36
|
-
export declare function createSmsTrustedChannel(): {
|
|
37
|
-
id: "ravi-sms-trusted";
|
|
38
|
-
meta: {
|
|
39
|
-
id: string;
|
|
40
|
-
label: string;
|
|
41
|
-
selectionLabel: string;
|
|
42
|
-
blurb: string;
|
|
43
|
-
aliases: string[];
|
|
44
|
-
};
|
|
45
|
-
capabilities: {
|
|
46
|
-
chatTypes: readonly ["direct"];
|
|
47
|
-
};
|
|
48
|
-
config: {
|
|
49
|
-
/**
|
|
50
|
-
* List all configured account IDs (identity UUIDs) for the ravi-sms-trusted channel.
|
|
51
|
-
*/
|
|
52
|
-
listAccountIds: (cfg: Record<string, unknown>) => string[];
|
|
53
|
-
/**
|
|
54
|
-
* Resolve an account configuration by its ID (identity UUID).
|
|
55
|
-
*/
|
|
56
|
-
resolveAccount: (cfg: Record<string, unknown>, accountId: string) => SmsTrustedAccountConfig;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Normalize an inbound SSE SMS event into a channel message envelope.
|
|
60
|
-
*
|
|
61
|
-
* Only trusted events reach this channel — no sender classification needed.
|
|
62
|
-
*/
|
|
63
|
-
normalizeInbound(event: SmsEvent, account: SmsTrustedAccountConfig): SmsTrustedInboundEnvelope | null;
|
|
64
|
-
outbound: {
|
|
65
|
-
deliveryMode: "direct";
|
|
66
|
-
/**
|
|
67
|
-
* Send an SMS reply to the phone number that triggered this session.
|
|
68
|
-
*
|
|
69
|
-
* Trusted SMS get full reply delivery — the agent can respond directly.
|
|
70
|
-
*/
|
|
71
|
-
sendText: (params: {
|
|
72
|
-
text: string;
|
|
73
|
-
client: RaviClient;
|
|
74
|
-
threadContext?: {
|
|
75
|
-
phoneNumber: string;
|
|
76
|
-
};
|
|
77
|
-
}) => Promise<{
|
|
78
|
-
ok: boolean;
|
|
79
|
-
error?: string;
|
|
80
|
-
}>;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Generate the session key for this channel.
|
|
84
|
-
*
|
|
85
|
-
* Format: `agent:{agentId}:ravi-sms-trusted:{accountId}:dm:{phoneNumber}`
|
|
86
|
-
*/
|
|
87
|
-
getSessionKey(agentId: string, accountId: string, phoneNumber: string): string;
|
|
88
|
-
gateway: {
|
|
89
|
-
/**
|
|
90
|
-
* Start monitoring inbound trusted SMS for a single identity account.
|
|
91
|
-
*
|
|
92
|
-
* Trusted SMS trigger an agent turn with CommandAuthorized: true.
|
|
93
|
-
* Replies are delivered via SMS.
|
|
94
|
-
*/
|
|
95
|
-
startAccount: (ctx: SmsTrustedGatewayContext) => Promise<void>;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
/** The singleton ravi-sms-trusted channel instance. */
|
|
99
|
-
export declare const raviSmsTrustedChannel: {
|
|
100
|
-
id: "ravi-sms-trusted";
|
|
101
|
-
meta: {
|
|
102
|
-
id: string;
|
|
103
|
-
label: string;
|
|
104
|
-
selectionLabel: string;
|
|
105
|
-
blurb: string;
|
|
106
|
-
aliases: string[];
|
|
107
|
-
};
|
|
108
|
-
capabilities: {
|
|
109
|
-
chatTypes: readonly ["direct"];
|
|
110
|
-
};
|
|
111
|
-
config: {
|
|
112
|
-
/**
|
|
113
|
-
* List all configured account IDs (identity UUIDs) for the ravi-sms-trusted channel.
|
|
114
|
-
*/
|
|
115
|
-
listAccountIds: (cfg: Record<string, unknown>) => string[];
|
|
116
|
-
/**
|
|
117
|
-
* Resolve an account configuration by its ID (identity UUID).
|
|
118
|
-
*/
|
|
119
|
-
resolveAccount: (cfg: Record<string, unknown>, accountId: string) => SmsTrustedAccountConfig;
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Normalize an inbound SSE SMS event into a channel message envelope.
|
|
123
|
-
*
|
|
124
|
-
* Only trusted events reach this channel — no sender classification needed.
|
|
125
|
-
*/
|
|
126
|
-
normalizeInbound(event: SmsEvent, account: SmsTrustedAccountConfig): SmsTrustedInboundEnvelope | null;
|
|
127
|
-
outbound: {
|
|
128
|
-
deliveryMode: "direct";
|
|
129
|
-
/**
|
|
130
|
-
* Send an SMS reply to the phone number that triggered this session.
|
|
131
|
-
*
|
|
132
|
-
* Trusted SMS get full reply delivery — the agent can respond directly.
|
|
133
|
-
*/
|
|
134
|
-
sendText: (params: {
|
|
135
|
-
text: string;
|
|
136
|
-
client: RaviClient;
|
|
137
|
-
threadContext?: {
|
|
138
|
-
phoneNumber: string;
|
|
139
|
-
};
|
|
140
|
-
}) => Promise<{
|
|
141
|
-
ok: boolean;
|
|
142
|
-
error?: string;
|
|
143
|
-
}>;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* Generate the session key for this channel.
|
|
147
|
-
*
|
|
148
|
-
* Format: `agent:{agentId}:ravi-sms-trusted:{accountId}:dm:{phoneNumber}`
|
|
149
|
-
*/
|
|
150
|
-
getSessionKey(agentId: string, accountId: string, phoneNumber: string): string;
|
|
151
|
-
gateway: {
|
|
152
|
-
/**
|
|
153
|
-
* Start monitoring inbound trusted SMS for a single identity account.
|
|
154
|
-
*
|
|
155
|
-
* Trusted SMS trigger an agent turn with CommandAuthorized: true.
|
|
156
|
-
* Replies are delivered via SMS.
|
|
157
|
-
*/
|
|
158
|
-
startAccount: (ctx: SmsTrustedGatewayContext) => Promise<void>;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
//# sourceMappingURL=sms-trusted.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sms-trusted.d.ts","sourceRoot":"","sources":["../../src/channels/sms-trusted.ts"],"names":[],"mappings":"AAAA,OAAO,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