@voidly/agent-sdk 1.8.0 → 1.8.2

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/dist/index.d.mts CHANGED
@@ -32,6 +32,7 @@ interface DecryptedMessage {
32
32
  to: string;
33
33
  content: string;
34
34
  contentType: string;
35
+ messageType: string;
35
36
  threadId: string | null;
36
37
  replyTo: string | null;
37
38
  signatureValid: boolean;
@@ -127,6 +128,7 @@ declare class VoidlyAgent {
127
128
  from?: string;
128
129
  threadId?: string;
129
130
  contentType?: string;
131
+ messageType?: string;
130
132
  unreadOnly?: boolean;
131
133
  }): Promise<DecryptedMessage[]>;
132
134
  /**
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ interface DecryptedMessage {
32
32
  to: string;
33
33
  content: string;
34
34
  contentType: string;
35
+ messageType: string;
35
36
  threadId: string | null;
36
37
  replyTo: string | null;
37
38
  signatureValid: boolean;
@@ -127,6 +128,7 @@ declare class VoidlyAgent {
127
128
  from?: string;
128
129
  threadId?: string;
129
130
  contentType?: string;
131
+ messageType?: string;
130
132
  unreadOnly?: boolean;
131
133
  }): Promise<DecryptedMessage[]>;
132
134
  /**
package/dist/index.js CHANGED
@@ -2465,7 +2465,16 @@ var VoidlyAgent = class _VoidlyAgent {
2465
2465
  const err = await res.json().catch(() => ({}));
2466
2466
  throw new Error(`Send failed: ${err.error?.message || err.error || res.statusText}`);
2467
2467
  }
2468
- return await res.json();
2468
+ const raw = await res.json();
2469
+ return {
2470
+ id: raw.id,
2471
+ from: raw.from,
2472
+ to: raw.to,
2473
+ timestamp: raw.timestamp,
2474
+ expiresAt: raw.expires_at || raw.expiresAt,
2475
+ encrypted: raw.encrypted,
2476
+ clientSide: raw.client_side || raw.clientSide
2477
+ };
2469
2478
  }
2470
2479
  /**
2471
2480
  * Receive and decrypt messages. Decryption happens locally.
@@ -2478,6 +2487,7 @@ var VoidlyAgent = class _VoidlyAgent {
2478
2487
  if (options.from) params.set("from", options.from);
2479
2488
  if (options.threadId) params.set("thread_id", options.threadId);
2480
2489
  if (options.contentType) params.set("content_type", options.contentType);
2490
+ if (options.messageType) params.set("message_type", options.messageType);
2481
2491
  if (options.unreadOnly) params.set("unread", "true");
2482
2492
  const res = await fetch(`${this.baseUrl}/v1/agent/receive/raw?${params}`, {
2483
2493
  headers: { "X-Agent-Key": this.apiKey }
@@ -2520,6 +2530,7 @@ var VoidlyAgent = class _VoidlyAgent {
2520
2530
  to: msg.to,
2521
2531
  content: (0, import_tweetnacl_util.encodeUTF8)(plaintext),
2522
2532
  contentType: msg.content_type,
2533
+ messageType: msg.message_type || "text",
2523
2534
  threadId: msg.thread_id,
2524
2535
  replyTo: msg.reply_to,
2525
2536
  signatureValid,
package/dist/index.mjs CHANGED
@@ -2455,7 +2455,16 @@ var VoidlyAgent = class _VoidlyAgent {
2455
2455
  const err = await res.json().catch(() => ({}));
2456
2456
  throw new Error(`Send failed: ${err.error?.message || err.error || res.statusText}`);
2457
2457
  }
2458
- return await res.json();
2458
+ const raw = await res.json();
2459
+ return {
2460
+ id: raw.id,
2461
+ from: raw.from,
2462
+ to: raw.to,
2463
+ timestamp: raw.timestamp,
2464
+ expiresAt: raw.expires_at || raw.expiresAt,
2465
+ encrypted: raw.encrypted,
2466
+ clientSide: raw.client_side || raw.clientSide
2467
+ };
2459
2468
  }
2460
2469
  /**
2461
2470
  * Receive and decrypt messages. Decryption happens locally.
@@ -2468,6 +2477,7 @@ var VoidlyAgent = class _VoidlyAgent {
2468
2477
  if (options.from) params.set("from", options.from);
2469
2478
  if (options.threadId) params.set("thread_id", options.threadId);
2470
2479
  if (options.contentType) params.set("content_type", options.contentType);
2480
+ if (options.messageType) params.set("message_type", options.messageType);
2471
2481
  if (options.unreadOnly) params.set("unread", "true");
2472
2482
  const res = await fetch(`${this.baseUrl}/v1/agent/receive/raw?${params}`, {
2473
2483
  headers: { "X-Agent-Key": this.apiKey }
@@ -2510,6 +2520,7 @@ var VoidlyAgent = class _VoidlyAgent {
2510
2520
  to: msg.to,
2511
2521
  content: (0, import_tweetnacl_util.encodeUTF8)(plaintext),
2512
2522
  contentType: msg.content_type,
2523
+ messageType: msg.message_type || "text",
2513
2524
  threadId: msg.thread_id,
2514
2525
  replyTo: msg.reply_to,
2515
2526
  signatureValid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidly/agent-sdk",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "E2E encrypted agent-to-agent communication SDK — true client-side encryption",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",