@meshagent/meshagent 0.50.0 → 0.51.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/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [0.51.1]
2
+ - Stability
3
+
4
+ ## [0.51.0]
5
+ - Refactored the chat UI to split input from feed, simplifying thread and dataset views and removing suggestion-driven behavior.
6
+ - Updated the JavaScript entrypoint and related tests to match the slimmer chat experience.
7
+
8
+ ## [0.50.1]
9
+ - Stability
10
+
1
11
  ## [0.50.0]
2
12
  - Chat clients now support per-turn LLM authorization providers, and websocket chat tokens are optional for `auth=none` deployments.
3
13
  - The typed client gained `connectLlm`, optional access-subject IDs, service-account principals, room and service enabled flags, `llm_quota_manager`, and the `router` project settings document.
@@ -78,6 +78,21 @@ export interface RoomInfo {
78
78
  metadata: Record<string, unknown>;
79
79
  annotations: Record<string, string>;
80
80
  }
81
+ export type RoomAllocationStatus = "Allocated" | "Unallocated";
82
+ export interface RoomStatus {
83
+ status: RoomAllocationStatus;
84
+ allocatedAt?: Date | null;
85
+ runningForSeconds?: number | null;
86
+ }
87
+ export interface RoomLifecycleEvent {
88
+ id: string;
89
+ roomName: string;
90
+ sessionId?: string | null;
91
+ type: string;
92
+ message: string;
93
+ severity?: string | null;
94
+ createdAt: Date;
95
+ }
81
96
  export interface GroupInfo {
82
97
  id: string;
83
98
  name: string;
@@ -591,6 +606,8 @@ export declare class Meshagent {
591
606
  private secretVersionPayload;
592
607
  private parseRoomSession;
593
608
  private parseRoom;
609
+ private parseRoomStatus;
610
+ private parseRoomLifecycleEvent;
594
611
  private parseGroup;
595
612
  private parseRoute;
596
613
  private parseFeed;
@@ -914,6 +931,10 @@ export declare class Meshagent {
914
931
  annotations?: Record<string, string>;
915
932
  }): Promise<RoomInfo>;
916
933
  getRoom(projectId: string, name: string): Promise<RoomInfo>;
934
+ getRoomStatus(projectId: string, name: string): Promise<RoomStatus>;
935
+ listRoomEvents(projectId: string, name: string, options?: {
936
+ limit?: number;
937
+ }): Promise<RoomLifecycleEvent[]>;
917
938
  updateRoom(projectId: string, roomId: string, name: string, options?: {
918
939
  metadata?: Record<string, unknown>;
919
940
  annotations?: Record<string, string>;
@@ -400,6 +400,54 @@ class Meshagent {
400
400
  annotations: annotations && typeof annotations === "object" ? annotations : {},
401
401
  };
402
402
  }
403
+ parseRoomStatus(data) {
404
+ if (!data || typeof data !== "object") {
405
+ throw new requirement_js_1.RoomException("Invalid room status payload");
406
+ }
407
+ const { status, allocated_at: allocatedAt, running_for_seconds: runningForSeconds, } = data;
408
+ if (status !== "Allocated" && status !== "Unallocated") {
409
+ throw new requirement_js_1.RoomException("Invalid room status payload: unknown status");
410
+ }
411
+ if (allocatedAt != null && typeof allocatedAt !== "string") {
412
+ throw new requirement_js_1.RoomException("Invalid room status payload: allocated_at must be a timestamp");
413
+ }
414
+ if (runningForSeconds != null && typeof runningForSeconds !== "number") {
415
+ throw new requirement_js_1.RoomException("Invalid room status payload: running_for_seconds must be a number");
416
+ }
417
+ return {
418
+ status,
419
+ allocatedAt: allocatedAt == null ? null : new Date(allocatedAt),
420
+ runningForSeconds: runningForSeconds == null ? null : runningForSeconds,
421
+ };
422
+ }
423
+ parseRoomLifecycleEvent(data) {
424
+ if (!data || typeof data !== "object") {
425
+ throw new requirement_js_1.RoomException("Invalid room lifecycle event payload");
426
+ }
427
+ const { id, room_name: roomName, session_id: sessionId, type, message, severity, created_at: createdAt, } = data;
428
+ if (typeof id !== "string"
429
+ || typeof roomName !== "string"
430
+ || typeof type !== "string"
431
+ || typeof message !== "string"
432
+ || typeof createdAt !== "string") {
433
+ throw new requirement_js_1.RoomException("Invalid room lifecycle event payload: missing required fields");
434
+ }
435
+ if (sessionId != null && typeof sessionId !== "string") {
436
+ throw new requirement_js_1.RoomException("Invalid room lifecycle event payload: session_id must be a string");
437
+ }
438
+ if (severity != null && typeof severity !== "string") {
439
+ throw new requirement_js_1.RoomException("Invalid room lifecycle event payload: severity must be a string");
440
+ }
441
+ return {
442
+ id,
443
+ roomName,
444
+ sessionId: sessionId == null ? null : sessionId,
445
+ type,
446
+ message,
447
+ severity: severity == null ? null : severity,
448
+ createdAt: new Date(createdAt),
449
+ };
450
+ }
403
451
  parseGroup(data) {
404
452
  if (!data || typeof data !== "object") {
405
453
  throw new requirement_js_1.RoomException("Invalid group payload");
@@ -1792,6 +1840,22 @@ class Meshagent {
1792
1840
  });
1793
1841
  return this.parseRoom(data);
1794
1842
  }
1843
+ async getRoomStatus(projectId, name) {
1844
+ const roomName = this.encodePathComponent(name);
1845
+ const data = await this.request(`/accounts/projects/${projectId}/rooms/${roomName}/status`, {
1846
+ action: "get room status",
1847
+ });
1848
+ return this.parseRoomStatus(data);
1849
+ }
1850
+ async listRoomEvents(projectId, name, options = {}) {
1851
+ const roomName = this.encodePathComponent(name);
1852
+ const data = await this.request(`/accounts/projects/${projectId}/rooms/${roomName}/events`, {
1853
+ query: { limit: options.limit ?? 100 },
1854
+ action: "list room lifecycle events",
1855
+ });
1856
+ const events = Array.isArray(data?.events) ? data.events : [];
1857
+ return events.map((event) => this.parseRoomLifecycleEvent(event));
1858
+ }
1795
1859
  async updateRoom(projectId, roomId, name, options = {}) {
1796
1860
  const payload = { name };
1797
1861
  if (options.metadata !== undefined) {
@@ -78,6 +78,21 @@ export interface RoomInfo {
78
78
  metadata: Record<string, unknown>;
79
79
  annotations: Record<string, string>;
80
80
  }
81
+ export type RoomAllocationStatus = "Allocated" | "Unallocated";
82
+ export interface RoomStatus {
83
+ status: RoomAllocationStatus;
84
+ allocatedAt?: Date | null;
85
+ runningForSeconds?: number | null;
86
+ }
87
+ export interface RoomLifecycleEvent {
88
+ id: string;
89
+ roomName: string;
90
+ sessionId?: string | null;
91
+ type: string;
92
+ message: string;
93
+ severity?: string | null;
94
+ createdAt: Date;
95
+ }
81
96
  export interface GroupInfo {
82
97
  id: string;
83
98
  name: string;
@@ -591,6 +606,8 @@ export declare class Meshagent {
591
606
  private secretVersionPayload;
592
607
  private parseRoomSession;
593
608
  private parseRoom;
609
+ private parseRoomStatus;
610
+ private parseRoomLifecycleEvent;
594
611
  private parseGroup;
595
612
  private parseRoute;
596
613
  private parseFeed;
@@ -914,6 +931,10 @@ export declare class Meshagent {
914
931
  annotations?: Record<string, string>;
915
932
  }): Promise<RoomInfo>;
916
933
  getRoom(projectId: string, name: string): Promise<RoomInfo>;
934
+ getRoomStatus(projectId: string, name: string): Promise<RoomStatus>;
935
+ listRoomEvents(projectId: string, name: string, options?: {
936
+ limit?: number;
937
+ }): Promise<RoomLifecycleEvent[]>;
917
938
  updateRoom(projectId: string, roomId: string, name: string, options?: {
918
939
  metadata?: Record<string, unknown>;
919
940
  annotations?: Record<string, string>;
@@ -395,6 +395,54 @@ export class Meshagent {
395
395
  annotations: annotations && typeof annotations === "object" ? annotations : {},
396
396
  };
397
397
  }
398
+ parseRoomStatus(data) {
399
+ if (!data || typeof data !== "object") {
400
+ throw new RoomException("Invalid room status payload");
401
+ }
402
+ const { status, allocated_at: allocatedAt, running_for_seconds: runningForSeconds, } = data;
403
+ if (status !== "Allocated" && status !== "Unallocated") {
404
+ throw new RoomException("Invalid room status payload: unknown status");
405
+ }
406
+ if (allocatedAt != null && typeof allocatedAt !== "string") {
407
+ throw new RoomException("Invalid room status payload: allocated_at must be a timestamp");
408
+ }
409
+ if (runningForSeconds != null && typeof runningForSeconds !== "number") {
410
+ throw new RoomException("Invalid room status payload: running_for_seconds must be a number");
411
+ }
412
+ return {
413
+ status,
414
+ allocatedAt: allocatedAt == null ? null : new Date(allocatedAt),
415
+ runningForSeconds: runningForSeconds == null ? null : runningForSeconds,
416
+ };
417
+ }
418
+ parseRoomLifecycleEvent(data) {
419
+ if (!data || typeof data !== "object") {
420
+ throw new RoomException("Invalid room lifecycle event payload");
421
+ }
422
+ const { id, room_name: roomName, session_id: sessionId, type, message, severity, created_at: createdAt, } = data;
423
+ if (typeof id !== "string"
424
+ || typeof roomName !== "string"
425
+ || typeof type !== "string"
426
+ || typeof message !== "string"
427
+ || typeof createdAt !== "string") {
428
+ throw new RoomException("Invalid room lifecycle event payload: missing required fields");
429
+ }
430
+ if (sessionId != null && typeof sessionId !== "string") {
431
+ throw new RoomException("Invalid room lifecycle event payload: session_id must be a string");
432
+ }
433
+ if (severity != null && typeof severity !== "string") {
434
+ throw new RoomException("Invalid room lifecycle event payload: severity must be a string");
435
+ }
436
+ return {
437
+ id,
438
+ roomName,
439
+ sessionId: sessionId == null ? null : sessionId,
440
+ type,
441
+ message,
442
+ severity: severity == null ? null : severity,
443
+ createdAt: new Date(createdAt),
444
+ };
445
+ }
398
446
  parseGroup(data) {
399
447
  if (!data || typeof data !== "object") {
400
448
  throw new RoomException("Invalid group payload");
@@ -1787,6 +1835,22 @@ export class Meshagent {
1787
1835
  });
1788
1836
  return this.parseRoom(data);
1789
1837
  }
1838
+ async getRoomStatus(projectId, name) {
1839
+ const roomName = this.encodePathComponent(name);
1840
+ const data = await this.request(`/accounts/projects/${projectId}/rooms/${roomName}/status`, {
1841
+ action: "get room status",
1842
+ });
1843
+ return this.parseRoomStatus(data);
1844
+ }
1845
+ async listRoomEvents(projectId, name, options = {}) {
1846
+ const roomName = this.encodePathComponent(name);
1847
+ const data = await this.request(`/accounts/projects/${projectId}/rooms/${roomName}/events`, {
1848
+ query: { limit: options.limit ?? 100 },
1849
+ action: "list room lifecycle events",
1850
+ });
1851
+ const events = Array.isArray(data?.events) ? data.events : [];
1852
+ return events.map((event) => this.parseRoomLifecycleEvent(event));
1853
+ }
1790
1854
  async updateRoom(projectId, roomId, name, options = {}) {
1791
1855
  const payload = { name };
1792
1856
  if (options.metadata !== undefined) {
@@ -78,6 +78,21 @@ export interface RoomInfo {
78
78
  metadata: Record<string, unknown>;
79
79
  annotations: Record<string, string>;
80
80
  }
81
+ export type RoomAllocationStatus = "Allocated" | "Unallocated";
82
+ export interface RoomStatus {
83
+ status: RoomAllocationStatus;
84
+ allocatedAt?: Date | null;
85
+ runningForSeconds?: number | null;
86
+ }
87
+ export interface RoomLifecycleEvent {
88
+ id: string;
89
+ roomName: string;
90
+ sessionId?: string | null;
91
+ type: string;
92
+ message: string;
93
+ severity?: string | null;
94
+ createdAt: Date;
95
+ }
81
96
  export interface GroupInfo {
82
97
  id: string;
83
98
  name: string;
@@ -591,6 +606,8 @@ export declare class Meshagent {
591
606
  private secretVersionPayload;
592
607
  private parseRoomSession;
593
608
  private parseRoom;
609
+ private parseRoomStatus;
610
+ private parseRoomLifecycleEvent;
594
611
  private parseGroup;
595
612
  private parseRoute;
596
613
  private parseFeed;
@@ -914,6 +931,10 @@ export declare class Meshagent {
914
931
  annotations?: Record<string, string>;
915
932
  }): Promise<RoomInfo>;
916
933
  getRoom(projectId: string, name: string): Promise<RoomInfo>;
934
+ getRoomStatus(projectId: string, name: string): Promise<RoomStatus>;
935
+ listRoomEvents(projectId: string, name: string, options?: {
936
+ limit?: number;
937
+ }): Promise<RoomLifecycleEvent[]>;
917
938
  updateRoom(projectId: string, roomId: string, name: string, options?: {
918
939
  metadata?: Record<string, unknown>;
919
940
  annotations?: Record<string, string>;
@@ -400,6 +400,54 @@ class Meshagent {
400
400
  annotations: annotations && typeof annotations === "object" ? annotations : {},
401
401
  };
402
402
  }
403
+ parseRoomStatus(data) {
404
+ if (!data || typeof data !== "object") {
405
+ throw new requirement_js_1.RoomException("Invalid room status payload");
406
+ }
407
+ const { status, allocated_at: allocatedAt, running_for_seconds: runningForSeconds, } = data;
408
+ if (status !== "Allocated" && status !== "Unallocated") {
409
+ throw new requirement_js_1.RoomException("Invalid room status payload: unknown status");
410
+ }
411
+ if (allocatedAt != null && typeof allocatedAt !== "string") {
412
+ throw new requirement_js_1.RoomException("Invalid room status payload: allocated_at must be a timestamp");
413
+ }
414
+ if (runningForSeconds != null && typeof runningForSeconds !== "number") {
415
+ throw new requirement_js_1.RoomException("Invalid room status payload: running_for_seconds must be a number");
416
+ }
417
+ return {
418
+ status,
419
+ allocatedAt: allocatedAt == null ? null : new Date(allocatedAt),
420
+ runningForSeconds: runningForSeconds == null ? null : runningForSeconds,
421
+ };
422
+ }
423
+ parseRoomLifecycleEvent(data) {
424
+ if (!data || typeof data !== "object") {
425
+ throw new requirement_js_1.RoomException("Invalid room lifecycle event payload");
426
+ }
427
+ const { id, room_name: roomName, session_id: sessionId, type, message, severity, created_at: createdAt, } = data;
428
+ if (typeof id !== "string"
429
+ || typeof roomName !== "string"
430
+ || typeof type !== "string"
431
+ || typeof message !== "string"
432
+ || typeof createdAt !== "string") {
433
+ throw new requirement_js_1.RoomException("Invalid room lifecycle event payload: missing required fields");
434
+ }
435
+ if (sessionId != null && typeof sessionId !== "string") {
436
+ throw new requirement_js_1.RoomException("Invalid room lifecycle event payload: session_id must be a string");
437
+ }
438
+ if (severity != null && typeof severity !== "string") {
439
+ throw new requirement_js_1.RoomException("Invalid room lifecycle event payload: severity must be a string");
440
+ }
441
+ return {
442
+ id,
443
+ roomName,
444
+ sessionId: sessionId == null ? null : sessionId,
445
+ type,
446
+ message,
447
+ severity: severity == null ? null : severity,
448
+ createdAt: new Date(createdAt),
449
+ };
450
+ }
403
451
  parseGroup(data) {
404
452
  if (!data || typeof data !== "object") {
405
453
  throw new requirement_js_1.RoomException("Invalid group payload");
@@ -1792,6 +1840,22 @@ class Meshagent {
1792
1840
  });
1793
1841
  return this.parseRoom(data);
1794
1842
  }
1843
+ async getRoomStatus(projectId, name) {
1844
+ const roomName = this.encodePathComponent(name);
1845
+ const data = await this.request(`/accounts/projects/${projectId}/rooms/${roomName}/status`, {
1846
+ action: "get room status",
1847
+ });
1848
+ return this.parseRoomStatus(data);
1849
+ }
1850
+ async listRoomEvents(projectId, name, options = {}) {
1851
+ const roomName = this.encodePathComponent(name);
1852
+ const data = await this.request(`/accounts/projects/${projectId}/rooms/${roomName}/events`, {
1853
+ query: { limit: options.limit ?? 100 },
1854
+ action: "list room lifecycle events",
1855
+ });
1856
+ const events = Array.isArray(data?.events) ? data.events : [];
1857
+ return events.map((event) => this.parseRoomLifecycleEvent(event));
1858
+ }
1795
1859
  async updateRoom(projectId, roomId, name, options = {}) {
1796
1860
  const payload = { name };
1797
1861
  if (options.metadata !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshagent/meshagent",
3
- "version": "0.50.0",
3
+ "version": "0.51.1",
4
4
  "description": "Meshagent Client",
5
5
  "homepage": "https://github.com/meshagent/meshagent-ts",
6
6
  "scripts": {