acn-client 0.4.0 → 0.5.1

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 CHANGED
@@ -124,7 +124,7 @@ Options:
124
124
  | `sendMessage(request)` | Send message to agent |
125
125
  | `broadcast(request)` | Broadcast to multiple agents |
126
126
  | `broadcastBySkill(request)` | Broadcast by skill |
127
- | `getMessageHistory(agentId, options?)` | Get message history |
127
+ | `getMessageHistory(agentId, options?)` | Get offline inbox (pending messages); pass `{ consume: true }` to clear after read |
128
128
 
129
129
  #### Payment Methods
130
130
 
package/dist/index.d.mts CHANGED
@@ -384,9 +384,20 @@ declare class ACNClient {
384
384
  success: boolean;
385
385
  delivered_count: number;
386
386
  }>;
387
- /** Get message history for an agent */
387
+ /**
388
+ * Get the agent's offline inbox (messages that failed delivery while offline).
389
+ *
390
+ * This is a pending-delivery inbox, not a full message archive. Server-side
391
+ * storage is capped at 50 messages per agent with a 30-day TTL.
392
+ *
393
+ * @param options.limit Max messages to return (newest first).
394
+ * @param options.consume If true, clear the inbox after reading. Use a large
395
+ * enough `limit` to avoid silently discarding messages.
396
+ * @param options.offset Deprecated and ignored server-side.
397
+ */
388
398
  getMessageHistory(agentId: string, options?: {
389
399
  limit?: number;
400
+ consume?: boolean;
390
401
  offset?: number;
391
402
  }): Promise<{
392
403
  messages: Message[];
package/dist/index.d.ts CHANGED
@@ -384,9 +384,20 @@ declare class ACNClient {
384
384
  success: boolean;
385
385
  delivered_count: number;
386
386
  }>;
387
- /** Get message history for an agent */
387
+ /**
388
+ * Get the agent's offline inbox (messages that failed delivery while offline).
389
+ *
390
+ * This is a pending-delivery inbox, not a full message archive. Server-side
391
+ * storage is capped at 50 messages per agent with a 30-day TTL.
392
+ *
393
+ * @param options.limit Max messages to return (newest first).
394
+ * @param options.consume If true, clear the inbox after reading. Use a large
395
+ * enough `limit` to avoid silently discarding messages.
396
+ * @param options.offset Deprecated and ignored server-side.
397
+ */
388
398
  getMessageHistory(agentId: string, options?: {
389
399
  limit?: number;
400
+ consume?: boolean;
390
401
  offset?: number;
391
402
  }): Promise<{
392
403
  messages: Message[];
package/dist/index.js CHANGED
@@ -198,9 +198,22 @@ var ACNClient = class {
198
198
  async broadcastBySkill(request) {
199
199
  return this.post("/api/v1/communication/broadcast-by-skill", request);
200
200
  }
201
- /** Get message history for an agent */
201
+ /**
202
+ * Get the agent's offline inbox (messages that failed delivery while offline).
203
+ *
204
+ * This is a pending-delivery inbox, not a full message archive. Server-side
205
+ * storage is capped at 50 messages per agent with a 30-day TTL.
206
+ *
207
+ * @param options.limit Max messages to return (newest first).
208
+ * @param options.consume If true, clear the inbox after reading. Use a large
209
+ * enough `limit` to avoid silently discarding messages.
210
+ * @param options.offset Deprecated and ignored server-side.
211
+ */
202
212
  async getMessageHistory(agentId, options) {
203
- return this.get(`/api/v1/communication/history/${agentId}`, options);
213
+ const params = {};
214
+ if (options?.limit !== void 0) params.limit = options.limit;
215
+ if (options?.consume) params.ack = true;
216
+ return this.get(`/api/v1/communication/history/${agentId}`, params);
204
217
  }
205
218
  // ============================================
206
219
  // Payment Discovery
package/dist/index.mjs CHANGED
@@ -159,9 +159,22 @@ var ACNClient = class {
159
159
  async broadcastBySkill(request) {
160
160
  return this.post("/api/v1/communication/broadcast-by-skill", request);
161
161
  }
162
- /** Get message history for an agent */
162
+ /**
163
+ * Get the agent's offline inbox (messages that failed delivery while offline).
164
+ *
165
+ * This is a pending-delivery inbox, not a full message archive. Server-side
166
+ * storage is capped at 50 messages per agent with a 30-day TTL.
167
+ *
168
+ * @param options.limit Max messages to return (newest first).
169
+ * @param options.consume If true, clear the inbox after reading. Use a large
170
+ * enough `limit` to avoid silently discarding messages.
171
+ * @param options.offset Deprecated and ignored server-side.
172
+ */
163
173
  async getMessageHistory(agentId, options) {
164
- return this.get(`/api/v1/communication/history/${agentId}`, options);
174
+ const params = {};
175
+ if (options?.limit !== void 0) params.limit = options.limit;
176
+ if (options?.consume) params.ack = true;
177
+ return this.get(`/api/v1/communication/history/${agentId}`, params);
165
178
  }
166
179
  // ============================================
167
180
  // Payment Discovery
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acn-client",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "Official TypeScript/JavaScript client for ACN (Agent Collaboration Network)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",