hiloop-sdk 0.5.0 → 0.5.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/client.d.ts CHANGED
@@ -280,6 +280,7 @@ export declare class HiloopClient {
280
280
  listConvSessionTimeline(sessionId: string, opts?: {
281
281
  limit?: number;
282
282
  before?: string;
283
+ after?: string;
283
284
  }): Promise<{
284
285
  items: Record<string, unknown>[];
285
286
  }>;
package/dist/client.js CHANGED
@@ -576,6 +576,8 @@ export class HiloopClient {
576
576
  params.limit = String(opts.limit);
577
577
  if (opts?.before !== undefined)
578
578
  params.before = opts.before;
579
+ if (opts?.after !== undefined)
580
+ params.after = opts.after;
579
581
  const result = await this.request("GET", `/agent/sessions/${sessionId}/timeline`, { params });
580
582
  // Decrypt timeline items (session messages + interaction fields)
581
583
  if (Array.isArray(result.items)) {
package/dist/ws.d.ts CHANGED
@@ -33,6 +33,7 @@ export declare class HiloopWsClient {
33
33
  private closed;
34
34
  private crypto;
35
35
  private initPromise;
36
+ private seenMessageIds;
36
37
  constructor(options: HiloopWsClientOptions);
37
38
  /** Initialize encryption context (derives keypair from API key, fetches space key). */
38
39
  private ensureCrypto;
package/dist/ws.js CHANGED
@@ -22,6 +22,7 @@ export class HiloopWsClient {
22
22
  this.closed = false;
23
23
  this.crypto = null;
24
24
  this.initPromise = null;
25
+ this.seenMessageIds = new Set();
25
26
  this.options = options;
26
27
  }
27
28
  /** Initialize encryption context (derives keypair from API key, fetches space key). */
@@ -87,6 +88,18 @@ export class HiloopWsClient {
87
88
  if (data.type === "message.new") {
88
89
  return;
89
90
  }
91
+ // Deduplicate messages delivered via multiple topics
92
+ if (data.messageId) {
93
+ if (this.seenMessageIds.has(data.messageId))
94
+ return;
95
+ this.seenMessageIds.add(data.messageId);
96
+ // Keep set bounded
97
+ if (this.seenMessageIds.size > 1000) {
98
+ const first = this.seenMessageIds.values().next().value;
99
+ if (first)
100
+ this.seenMessageIds.delete(first);
101
+ }
102
+ }
90
103
  // Auto-decrypt session messages
91
104
  if (data.type === "session.message.new" && data.encryptedContent && this.crypto) {
92
105
  const plain = await this.crypto.decryptSessionMessage(data.encryptedContent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hiloop-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "TypeScript SDK for Hiloop — zero-trust human-AI agent interaction platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",