@voidly/agent-sdk 3.4.8 → 3.5.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/README.md +2 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -202,6 +202,8 @@ node examples/quickstart.mjs
|
|
|
202
202
|
| [rpc.mjs](examples/rpc.mjs) | Remote procedure calls between agents |
|
|
203
203
|
| [conversation.mjs](examples/conversation.mjs) | Threaded dialog with waitForReply |
|
|
204
204
|
| [censorship-monitor.mjs](examples/censorship-monitor.mjs) | Real-world: censorship data + encrypted alerts |
|
|
205
|
+
| [sse-streaming.mjs](examples/sse-streaming.mjs) | Real-time message delivery via Server-Sent Events |
|
|
206
|
+
| [post-quantum.mjs](examples/post-quantum.mjs) | ML-KEM-768 hybrid post-quantum key exchange |
|
|
205
207
|
|
|
206
208
|
All examples are self-contained and run against the public relay. No API key needed.
|
|
207
209
|
|
package/dist/index.d.ts
CHANGED
|
@@ -449,6 +449,48 @@ declare class VoidlyAgent {
|
|
|
449
449
|
* Rotate this agent's keypairs. Old messages encrypted with old keys cannot be re-decrypted.
|
|
450
450
|
*/
|
|
451
451
|
rotateKeys(): Promise<void>;
|
|
452
|
+
/**
|
|
453
|
+
* Claim a username. One username per DID. Lowercase alphanumeric + underscore, 3-32 chars.
|
|
454
|
+
* @throws Error if username is taken, invalid, or you already have one (use changeUsername).
|
|
455
|
+
*/
|
|
456
|
+
claimUsername(username: string): Promise<{
|
|
457
|
+
username: string;
|
|
458
|
+
did: string;
|
|
459
|
+
claimed_at: string;
|
|
460
|
+
}>;
|
|
461
|
+
/**
|
|
462
|
+
* Change your username atomically (releases old, claims new).
|
|
463
|
+
* @throws Error if new username is taken or invalid.
|
|
464
|
+
*/
|
|
465
|
+
changeUsername(username: string): Promise<{
|
|
466
|
+
username: string;
|
|
467
|
+
did: string;
|
|
468
|
+
claimed_at: string;
|
|
469
|
+
}>;
|
|
470
|
+
/**
|
|
471
|
+
* Release your username, making it available for others.
|
|
472
|
+
*/
|
|
473
|
+
releaseUsername(): Promise<void>;
|
|
474
|
+
/**
|
|
475
|
+
* Get your current username (if any).
|
|
476
|
+
*/
|
|
477
|
+
getMyUsername(): Promise<string | null>;
|
|
478
|
+
/**
|
|
479
|
+
* Resolve a @username to a DID + public profile. No auth required.
|
|
480
|
+
* Returns null if username not found.
|
|
481
|
+
*/
|
|
482
|
+
static resolveUsername(username: string, baseUrl?: string): Promise<{
|
|
483
|
+
username: string;
|
|
484
|
+
did: string;
|
|
485
|
+
display_name: string | null;
|
|
486
|
+
signing_public_key: string;
|
|
487
|
+
encryption_public_key: string;
|
|
488
|
+
capabilities: string[];
|
|
489
|
+
last_seen: string | null;
|
|
490
|
+
message_count: number;
|
|
491
|
+
mlkem_public_key: string | null;
|
|
492
|
+
claimed_at: string;
|
|
493
|
+
} | null>;
|
|
452
494
|
/**
|
|
453
495
|
* Create an encrypted channel. Messages are encrypted at rest with NaCl secretbox.
|
|
454
496
|
* Only authenticated agents with did:voidly: identities can join and read.
|