@elizaos/server 1.4.2 → 1.4.4

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.
@@ -14,9 +14,9 @@
14
14
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
15
  <link rel="icon" type="image/x-icon" href="/favicon.ico" />
16
16
  <title>ElizaOS - Client</title>
17
- <script type="module" crossorigin src="/assets/index-ofROTcnX.js"></script>
18
- <link rel="modulepreload" crossorigin href="/assets/vendor-BDSOQlwO.js">
19
- <link rel="stylesheet" crossorigin href="/assets/index-CuhlDCnv.css">
17
+ <script type="module" crossorigin src="/assets/index-l7vDDpLb.js"></script>
18
+ <link rel="modulepreload" crossorigin href="/assets/vendor-BWzYG1ky.js">
19
+ <link rel="stylesheet" crossorigin href="/assets/index-DESjREgK.css">
20
20
  </head>
21
21
  <body>
22
22
  <div id="root"></div>
package/dist/index.d.ts CHANGED
@@ -3,6 +3,19 @@ import express from 'express';
3
3
  import http from 'node:http';
4
4
  import { Server } from 'socket.io';
5
5
 
6
+ /**
7
+ * Session timeout configuration
8
+ */
9
+ interface SessionTimeoutConfig {
10
+ /** Timeout in minutes. If not specified, uses agent or global default */
11
+ timeoutMinutes?: number;
12
+ /** Whether to auto-renew the session on activity */
13
+ autoRenew?: boolean;
14
+ /** Maximum session duration in minutes (even with renewals) */
15
+ maxDurationMinutes?: number;
16
+ /** Warning threshold in minutes before timeout */
17
+ warningThresholdMinutes?: number;
18
+ }
6
19
  /**
7
20
  * Metadata associated with a session
8
21
  */
@@ -24,6 +37,17 @@ interface Session {
24
37
  metadata: SessionMetadata;
25
38
  createdAt: Date;
26
39
  lastActivity: Date;
40
+ /** Session expiration time */
41
+ expiresAt: Date;
42
+ /** Session timeout configuration */
43
+ timeoutConfig: SessionTimeoutConfig;
44
+ /** Number of times the session has been renewed */
45
+ renewalCount: number;
46
+ /** Whether a warning has been sent about upcoming expiration */
47
+ warningState?: {
48
+ sent: boolean;
49
+ sentAt?: Date;
50
+ };
27
51
  }
28
52
  /**
29
53
  * Request body for creating a session
@@ -32,6 +56,8 @@ interface CreateSessionRequest {
32
56
  agentId: string;
33
57
  userId: string;
34
58
  metadata?: SessionMetadata;
59
+ /** Optional timeout configuration for this session */
60
+ timeoutConfig?: SessionTimeoutConfig;
35
61
  }
36
62
  /**
37
63
  * Response for session creation
@@ -42,6 +68,10 @@ interface CreateSessionResponse {
42
68
  userId: UUID;
43
69
  createdAt: Date;
44
70
  metadata: SessionMetadata;
71
+ /** When the session will expire */
72
+ expiresAt: Date;
73
+ /** Session timeout configuration */
74
+ timeoutConfig: SessionTimeoutConfig;
45
75
  }
46
76
  /**
47
77
  * Request body for sending a message
@@ -84,6 +114,13 @@ interface SimplifiedMessage {
84
114
  interface GetMessagesResponse {
85
115
  messages: SimplifiedMessage[];
86
116
  hasMore: boolean;
117
+ /** Pagination cursors for navigating through messages */
118
+ cursors?: {
119
+ /** Timestamp to use for getting older messages (pagination backward) */
120
+ before?: number;
121
+ /** Timestamp to use for getting newer messages (pagination forward) */
122
+ after?: number;
123
+ };
87
124
  }
88
125
  /**
89
126
  * Session info response
@@ -95,6 +132,16 @@ interface SessionInfoResponse {
95
132
  createdAt: Date;
96
133
  lastActivity: Date;
97
134
  metadata: SessionMetadata;
135
+ /** When the session will expire */
136
+ expiresAt: Date;
137
+ /** Session timeout configuration */
138
+ timeoutConfig: SessionTimeoutConfig;
139
+ /** Number of times the session has been renewed */
140
+ renewalCount: number;
141
+ /** Time remaining in milliseconds */
142
+ timeRemaining: number;
143
+ /** Whether the session is near expiration */
144
+ isNearExpiration: boolean;
98
145
  }
99
146
  /**
100
147
  * Health check response
@@ -363,4 +410,4 @@ declare class AgentServer {
363
410
  private registerSignalHandlers;
364
411
  }
365
412
 
366
- export { AgentServer, type CentralRootMessage, type CreateSessionRequest, type CreateSessionResponse, type GetMessagesQuery, type GetMessagesResponse, type HealthCheckResponse, type MessageChannel, type MessageServer, type MessageServiceStructure, type SendMessageRequest, type ServerMiddleware, type ServerOptions, type Session, type SessionInfoResponse, type SessionMetadata, type SimplifiedMessage, expandTildePath, hasValidRemoteUrls, isWebUIEnabled, jsonToCharacter, loadCharacter, loadCharacterTryPath, loadCharacters, loadCharactersFromUrl, resolvePgliteDir, tryLoadFile };
413
+ export { AgentServer, type CentralRootMessage, type CreateSessionRequest, type CreateSessionResponse, type GetMessagesQuery, type GetMessagesResponse, type HealthCheckResponse, type MessageChannel, type MessageServer, type MessageServiceStructure, type SendMessageRequest, type ServerMiddleware, type ServerOptions, type Session, type SessionInfoResponse, type SessionMetadata, type SessionTimeoutConfig, type SimplifiedMessage, expandTildePath, hasValidRemoteUrls, isWebUIEnabled, jsonToCharacter, loadCharacter, loadCharacterTryPath, loadCharacters, loadCharactersFromUrl, resolvePgliteDir, tryLoadFile };