@steventsao/agent-session 0.1.24 → 0.1.26

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
@@ -10,6 +10,8 @@ interface AgentSessionClientOptions {
10
10
  sessionId: string;
11
11
  /** User ID for session tracking */
12
12
  userId?: string;
13
+ /** Optional role for lifecycle impact */
14
+ role?: 'participant' | 'observer';
13
15
  /** Max reconnection attempts (default: 5) */
14
16
  maxReconnectAttempts?: number;
15
17
  /** Auto-reconnect on disconnect (default: true) */
@@ -28,6 +30,7 @@ declare class AgentSessionClient {
28
30
  private baseUrl;
29
31
  private sessionId;
30
32
  private userId;
33
+ private role;
31
34
  private pingIntervalId;
32
35
  private reconnectTimeout;
33
36
  private reconnectAttempts;
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ var AgentSessionClient = class {
7
7
  baseUrl;
8
8
  sessionId;
9
9
  userId;
10
+ role;
10
11
  pingIntervalId = null;
11
12
  reconnectTimeout = null;
12
13
  reconnectAttempts = 0;
@@ -24,6 +25,7 @@ var AgentSessionClient = class {
24
25
  this.baseUrl = options.url.replace(/\/$/, "");
25
26
  this.sessionId = options.sessionId;
26
27
  this.userId = options.userId || null;
28
+ this.role = options.role || null;
27
29
  this.maxReconnectAttempts = options.maxReconnectAttempts ?? 5;
28
30
  this.autoReconnect = options.autoReconnect ?? true;
29
31
  this.pingInterval = options.pingInterval ?? 3e4;
@@ -44,6 +46,7 @@ var AgentSessionClient = class {
44
46
  const thisSocketId = ++this.socketId;
45
47
  const params = new URLSearchParams();
46
48
  if (this.userId) params.set("userId", this.userId);
49
+ if (this.role) params.set("role", this.role);
47
50
  const url = `${this.baseUrl}/session/${this.sessionId}/ws?${params}`;
48
51
  console.log("[AgentSession] Connecting to:", url);
49
52
  this.ws = new WebSocket(url);
package/dist/react.js CHANGED
@@ -7,6 +7,7 @@ var AgentSessionClient = class {
7
7
  baseUrl;
8
8
  sessionId;
9
9
  userId;
10
+ role;
10
11
  pingIntervalId = null;
11
12
  reconnectTimeout = null;
12
13
  reconnectAttempts = 0;
@@ -24,6 +25,7 @@ var AgentSessionClient = class {
24
25
  this.baseUrl = options.url.replace(/\/$/, "");
25
26
  this.sessionId = options.sessionId;
26
27
  this.userId = options.userId || null;
28
+ this.role = options.role || null;
27
29
  this.maxReconnectAttempts = options.maxReconnectAttempts ?? 5;
28
30
  this.autoReconnect = options.autoReconnect ?? true;
29
31
  this.pingInterval = options.pingInterval ?? 3e4;
@@ -44,6 +46,7 @@ var AgentSessionClient = class {
44
46
  const thisSocketId = ++this.socketId;
45
47
  const params = new URLSearchParams();
46
48
  if (this.userId) params.set("userId", this.userId);
49
+ if (this.role) params.set("role", this.role);
47
50
  const url = `${this.baseUrl}/session/${this.sessionId}/ws?${params}`;
48
51
  console.log("[AgentSession] Connecting to:", url);
49
52
  this.ws = new WebSocket(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steventsao/agent-session",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Client SDK for agent-session - WebSocket sessions with E2B sandboxes and AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  "dev": "tsup --watch"
28
28
  },
29
29
  "dependencies": {
30
- "@steventsao/agent-session-core": "workspace:*"
30
+ "@steventsao/agent-session-core": "^0.1.14"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@reduxjs/toolkit": "^2.0.0",