@origonai/web-sdk 0.1.4 → 0.1.5

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
@@ -59,7 +59,8 @@ await client.endSession(sessionId)
59
59
  ### Sessions
60
60
  - `startSession({ channel, sessionId?, data? })` — originate a chat or voice session (issues `POST /session/start`)
61
61
  - `joinSession({ channel, sessionId, url, token, chat?, voice? })` — attach to a session provisioned out of band, skipping `POST /session/start`; `chat.recovery` opts into caller-authorized server-replay recovery, while `voice.receiveOnly` starts playout with no microphone and awaits server uplink mute before connecting (see [Joining a provisioned session](#joining-a-provisioned-session))
62
- - `endSession(sessionId)` — close a session
62
+ - `endChat(sessionId)` — end an owned customer chat, retaining its transcript; duplicate requests coalesce.
63
+ - `endSession(sessionId)` — close the local session; customer chat cleanup detaches without ending the conversation
63
64
  - `endAllSessions()` — close every active session
64
65
  - `migrateSessionId(oldId, newId)` — re-key a live session whose id the control plane reassigned mid-call, without a media re-dial
65
66
  - `activeSessionIds()` — list active sessions
package/dist/index.d.ts CHANGED
@@ -54,6 +54,8 @@ export declare class ClientError extends Error {
54
54
  static serverUnavailable(status: number): ClientError;
55
55
  static http(status: number, code: string, message: string): ClientError;
56
56
  static attachment(code: AttachmentErrorCode, message: string): ClientError;
57
+ static chatEndPending(): ClientError;
58
+ static chatEndUnconfirmed(): ClientError;
57
59
  static cancelled(): ClientError;
58
60
  static other(message: string): ClientError;
59
61
  static session(message: string): ClientError;
@@ -66,7 +68,7 @@ export declare interface ClientErrorJSON {
66
68
  message: string;
67
69
  }
68
70
 
69
- export declare type ClientErrorKind = 'notInitialized' | 'noSession' | 'session' | 'missingField' | 'serverUnavailable' | 'http' | 'attachment' | 'cancelled' | 'other';
71
+ export declare type ClientErrorKind = 'notInitialized' | 'noSession' | 'session' | 'missingField' | 'serverUnavailable' | 'http' | 'attachment' | 'cancelled' | 'chatEndPending' | 'chatEndUnconfirmed' | 'other';
70
72
 
71
73
  /**
72
74
  * Cached response of `POST /config`. Shape matches the backend wire
@@ -475,6 +477,8 @@ export declare class SessionManager {
475
477
  private attachmentBearer;
476
478
  private readonly dispatcher;
477
479
  private readonly sessions;
480
+ private readonly chatOwners;
481
+ private readonly endingChats;
478
482
  private readonly pendingUploads;
479
483
  initialize(credentials: Credentials): void;
480
484
  authenticate(): Promise<ConfigData>;
@@ -515,6 +519,9 @@ export declare class SessionManager {
515
519
  * the MoQ `ConnectOk` lands — so this method must NOT fire it for voice.
516
520
  */
517
521
  private attachSession;
522
+ private prepareChatOpen;
523
+ /** End the customer conversation; endSession remains local cleanup/Leave. */
524
+ endChat(sessionId: string): Promise<void>;
518
525
  endSession(sessionId: string): Promise<void>;
519
526
  endAllSessions(): Promise<void>;
520
527
  /**