@pingagent/sdk 0.1.1 → 0.1.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.ts CHANGED
@@ -151,6 +151,8 @@ interface ConversationEntry {
151
151
  target_did: string;
152
152
  trusted: boolean;
153
153
  created_at: number;
154
+ /** Server-side last message write time (ms). Omitted or null when unknown; client should fetch when missing. */
155
+ last_activity_at?: number | null;
154
156
  }
155
157
  interface ConversationListResponse {
156
158
  conversations: ConversationEntry[];
@@ -473,6 +475,8 @@ interface WsSubscriptionOptions {
473
475
  onMessage: (envelope: any, conversationId: string) => void;
474
476
  onControl?: (control: WsControlPayload, conversationId: string) => void;
475
477
  onError?: (err: Error) => void;
478
+ /** Called when a WebSocket opens or reopens; e.g. Skill can run catchUp to fill gaps. */
479
+ onOpen?: (conversationId: string) => void;
476
480
  }
477
481
  declare class WsSubscription {
478
482
  private opts;
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  loadIdentity,
17
17
  saveIdentity,
18
18
  updateStoredToken
19
- } from "./chunk-4SRPVWK4.js";
19
+ } from "./chunk-MDGELIR5.js";
20
20
  export {
21
21
  A2AAdapter,
22
22
  ContactManager,
@@ -5,7 +5,7 @@ import {
5
5
  ensureTokenValid,
6
6
  loadIdentity,
7
7
  updateStoredToken
8
- } from "./chunk-4SRPVWK4.js";
8
+ } from "./chunk-MDGELIR5.js";
9
9
 
10
10
  // src/web-server.ts
11
11
  import * as fs from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingagent/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/client.ts CHANGED
@@ -62,6 +62,8 @@ export interface ConversationEntry {
62
62
  target_did: string;
63
63
  trusted: boolean;
64
64
  created_at: number;
65
+ /** Server-side last message write time (ms). Omitted or null when unknown; client should fetch when missing. */
66
+ last_activity_at?: number | null;
65
67
  }
66
68
 
67
69
  export interface ConversationListResponse {
@@ -19,6 +19,8 @@ export interface WsSubscriptionOptions {
19
19
  onMessage: (envelope: any, conversationId: string) => void;
20
20
  onControl?: (control: WsControlPayload, conversationId: string) => void;
21
21
  onError?: (err: Error) => void;
22
+ /** Called when a WebSocket opens or reopens; e.g. Skill can run catchUp to fill gaps. */
23
+ onOpen?: (conversationId: string) => void;
22
24
  }
23
25
 
24
26
  const RECONNECT_BASE_MS = 1000;
@@ -106,6 +108,7 @@ export class WsSubscription {
106
108
 
107
109
  ws.on('open', () => {
108
110
  this.reconnectAttempts.set(conversationId, 0);
111
+ this.opts.onOpen?.(conversationId);
109
112
  // ws_connected will arrive as first message
110
113
  });
111
114