@voidly/agent-sdk 1.1.0 → 1.2.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/dist/index.d.mts CHANGED
@@ -124,6 +124,22 @@ declare class VoidlyAgent {
124
124
  since?: string;
125
125
  limit?: number;
126
126
  }): Promise<DecryptedMessage[]>;
127
+ /**
128
+ * Delete a message by ID (must be sender or recipient).
129
+ */
130
+ deleteMessage(messageId: string): Promise<boolean>;
131
+ /**
132
+ * Get this agent's own profile.
133
+ */
134
+ getProfile(): Promise<AgentProfile>;
135
+ /**
136
+ * Update this agent's profile (name, capabilities, metadata).
137
+ */
138
+ updateProfile(updates: {
139
+ name?: string;
140
+ capabilities?: string[];
141
+ metadata?: Record<string, unknown>;
142
+ }): Promise<void>;
127
143
  /**
128
144
  * Look up an agent's public profile and keys.
129
145
  */
package/dist/index.d.ts CHANGED
@@ -124,6 +124,22 @@ declare class VoidlyAgent {
124
124
  since?: string;
125
125
  limit?: number;
126
126
  }): Promise<DecryptedMessage[]>;
127
+ /**
128
+ * Delete a message by ID (must be sender or recipient).
129
+ */
130
+ deleteMessage(messageId: string): Promise<boolean>;
131
+ /**
132
+ * Get this agent's own profile.
133
+ */
134
+ getProfile(): Promise<AgentProfile>;
135
+ /**
136
+ * Update this agent's profile (name, capabilities, metadata).
137
+ */
138
+ updateProfile(updates: {
139
+ name?: string;
140
+ capabilities?: string[];
141
+ metadata?: Record<string, unknown>;
142
+ }): Promise<void>;
127
143
  /**
128
144
  * Look up an agent's public profile and keys.
129
145
  */
package/dist/index.js CHANGED
@@ -2526,6 +2526,47 @@ var VoidlyAgent = class _VoidlyAgent {
2526
2526
  }
2527
2527
  return decrypted;
2528
2528
  }
2529
+ // ─── Message Management ─────────────────────────────────────────────────────
2530
+ /**
2531
+ * Delete a message by ID (must be sender or recipient).
2532
+ */
2533
+ async deleteMessage(messageId) {
2534
+ const res = await fetch(`${this.baseUrl}/v1/agent/messages/${messageId}`, {
2535
+ method: "DELETE",
2536
+ headers: { "X-Agent-Key": this.apiKey }
2537
+ });
2538
+ return res.ok;
2539
+ }
2540
+ // ─── Profile ──────────────────────────────────────────────────────────────
2541
+ /**
2542
+ * Get this agent's own profile.
2543
+ */
2544
+ async getProfile() {
2545
+ const res = await fetch(`${this.baseUrl}/v1/agent/profile`, {
2546
+ headers: { "X-Agent-Key": this.apiKey }
2547
+ });
2548
+ if (!res.ok) {
2549
+ throw new Error("Failed to fetch profile");
2550
+ }
2551
+ return await res.json();
2552
+ }
2553
+ /**
2554
+ * Update this agent's profile (name, capabilities, metadata).
2555
+ */
2556
+ async updateProfile(updates) {
2557
+ const res = await fetch(`${this.baseUrl}/v1/agent/profile`, {
2558
+ method: "PATCH",
2559
+ headers: {
2560
+ "Content-Type": "application/json",
2561
+ "X-Agent-Key": this.apiKey
2562
+ },
2563
+ body: JSON.stringify(updates)
2564
+ });
2565
+ if (!res.ok) {
2566
+ const err = await res.json().catch(() => ({}));
2567
+ throw new Error(`Profile update failed: ${err.error || res.statusText}`);
2568
+ }
2569
+ }
2529
2570
  // ─── Discovery ──────────────────────────────────────────────────────────────
2530
2571
  /**
2531
2572
  * Look up an agent's public profile and keys.
package/dist/index.mjs CHANGED
@@ -2516,6 +2516,47 @@ var VoidlyAgent = class _VoidlyAgent {
2516
2516
  }
2517
2517
  return decrypted;
2518
2518
  }
2519
+ // ─── Message Management ─────────────────────────────────────────────────────
2520
+ /**
2521
+ * Delete a message by ID (must be sender or recipient).
2522
+ */
2523
+ async deleteMessage(messageId) {
2524
+ const res = await fetch(`${this.baseUrl}/v1/agent/messages/${messageId}`, {
2525
+ method: "DELETE",
2526
+ headers: { "X-Agent-Key": this.apiKey }
2527
+ });
2528
+ return res.ok;
2529
+ }
2530
+ // ─── Profile ──────────────────────────────────────────────────────────────
2531
+ /**
2532
+ * Get this agent's own profile.
2533
+ */
2534
+ async getProfile() {
2535
+ const res = await fetch(`${this.baseUrl}/v1/agent/profile`, {
2536
+ headers: { "X-Agent-Key": this.apiKey }
2537
+ });
2538
+ if (!res.ok) {
2539
+ throw new Error("Failed to fetch profile");
2540
+ }
2541
+ return await res.json();
2542
+ }
2543
+ /**
2544
+ * Update this agent's profile (name, capabilities, metadata).
2545
+ */
2546
+ async updateProfile(updates) {
2547
+ const res = await fetch(`${this.baseUrl}/v1/agent/profile`, {
2548
+ method: "PATCH",
2549
+ headers: {
2550
+ "Content-Type": "application/json",
2551
+ "X-Agent-Key": this.apiKey
2552
+ },
2553
+ body: JSON.stringify(updates)
2554
+ });
2555
+ if (!res.ok) {
2556
+ const err = await res.json().catch(() => ({}));
2557
+ throw new Error(`Profile update failed: ${err.error || res.statusText}`);
2558
+ }
2559
+ }
2519
2560
  // ─── Discovery ──────────────────────────────────────────────────────────────
2520
2561
  /**
2521
2562
  * Look up an agent's public profile and keys.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidly/agent-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
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",