@vibexnpm/talkx 8.7.0 → 8.9.0

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
@@ -26,6 +26,8 @@ export const ErrorTypes: {
26
26
  readonly CONNECTION_FAILED: 'CONNECTION_FAILED';
27
27
  readonly CONNECTION_LOST: 'CONNECTION_LOST';
28
28
  readonly CONNECTION_TIMEOUT: 'CONNECTION_TIMEOUT';
29
+ /** 회사 구독 없음(결제 전·해지) — 웹소켓이 멈췄다. 결제 확인 뒤 `connect()` 를 다시 부른다. */
30
+ readonly SUBSCRIPTION_REQUIRED: 'SUBSCRIPTION_REQUIRED';
29
31
  readonly JWT_INVALID: 'JWT_INVALID';
30
32
  readonly JWT_EXPIRED: 'JWT_EXPIRED';
31
33
  readonly JWT_PARSE_FAILED: 'JWT_PARSE_FAILED';
@@ -1507,7 +1509,7 @@ export interface AssistantProgressEvent {
1507
1509
  /** 진행 주체 페르소나 ID. */
1508
1510
  personaId: string | null;
1509
1511
  /** 진행 단계 — `active:true` 일 때. 종료 시 null. */
1510
- phase: 'THINKING' | 'SEARCHING' | 'PLANNING' | 'DOCUMENT_ANALYSIS' | 'VIDEO_ANALYSIS' | 'WRITING' | null;
1512
+ phase: 'THINKING' | 'SEARCHING' | 'PLANNING' | 'DOCUMENT_ANALYSIS' | 'VIDEO_ANALYSIS' | 'WEB_READING' | 'WRITING' | null;
1511
1513
  /** DOCUMENT_ANALYSIS의 실측 진행률. 같은 phase heartbeat 사이와 재입장 후에도 보존된다. */
1512
1514
  progress?: DocumentAnalysisProgress | null;
1513
1515
  /** phase 의 기본 표시 라벨(예: "생각 중…"). SDK 매핑 — 커스텀하려면 `phase` 사용. 종료 시 null. */
@@ -1578,7 +1580,7 @@ export interface AssistantRoomProgressEvent {
1578
1580
  /** 표시 기준이 된 stream (가장 최근 갱신). 없으면 null. */
1579
1581
  streamId: string | null;
1580
1582
  personaId: string | null;
1581
- phase: 'THINKING' | 'SEARCHING' | 'PLANNING' | 'DOCUMENT_ANALYSIS' | 'VIDEO_ANALYSIS' | 'WRITING' | null;
1583
+ phase: 'THINKING' | 'SEARCHING' | 'PLANNING' | 'DOCUMENT_ANALYSIS' | 'VIDEO_ANALYSIS' | 'WEB_READING' | 'WRITING' | null;
1582
1584
  progress?: DocumentAnalysisProgress | null;
1583
1585
  label: string | null;
1584
1586
  /** 표시 기준 stream 의 누적 본문. `textAvailable:false` 거나 진행 중이 아니면 null. */
@@ -1591,7 +1593,7 @@ export interface AssistantRoomProgressEvent {
1591
1593
  export interface AssistantProgressStreamSnapshot {
1592
1594
  streamId: string;
1593
1595
  personaId: string | null;
1594
- phase: 'THINKING' | 'SEARCHING' | 'PLANNING' | 'DOCUMENT_ANALYSIS' | 'VIDEO_ANALYSIS' | 'WRITING' | null;
1596
+ phase: 'THINKING' | 'SEARCHING' | 'PLANNING' | 'DOCUMENT_ANALYSIS' | 'VIDEO_ANALYSIS' | 'WEB_READING' | 'WRITING' | null;
1595
1597
  progress?: DocumentAnalysisProgress | null;
1596
1598
  label: string | null;
1597
1599
  text: string | null;
@@ -1997,7 +1999,7 @@ export interface RetentionCleanupPayload {
1997
1999
  /**
1998
2000
  * TalkFlowClient 이벤트 맵 — 런타임 {@code TalkFlowClient.js} 의 {@code this.emit(...)} 호출 기반.
1999
2001
  *
2000
- * <p><b>Connection 관련</b>: stateChange, connected, disconnected, reconnecting, reconnected, resumed, connectionError, tokenSet, loggedOut</p>
2002
+ * <p><b>Connection 관련</b>: stateChange, connected, disconnected, reconnecting, reconnected, resumed, subscriptionRequired, connectionError, tokenSet, loggedOut</p>
2001
2003
  * <p><b>Chat 관련 (ChatClient 이벤트를 이 이름으로 re-emit)</b>: chatMessage, newChatMessage, messageUpdated, messageDeleted, reactionChanged, linkPreviewAttached, messageRead, typing, assistantProgress, memberJoined, memberLeft, roomSubscribed, roomUnsubscribed, roomListSubscribed, roomListUnsubscribed, roomListUpdate, roomListMessage, roomListCreated, roomListJoined, roomListLeft, roomListSelfLeft, roomListRoomUpdated, retentionCleanup</p>
2002
2004
  * <p><b>Push 관련</b>: pushEnabled, pushFailed, pushNotification</p>
2003
2005
  * <p><b>WebRTC 관련</b>: localStreamStarted, localStreamStopped, remoteTrack, screenShareStarted, screenShareEnded, deviceChange, mediaStateChanged, callStarted, callEnded, callRequested, callAccepted, callRejected, callCancelled, callInvitation, callBusy, incomingCall, incomingCallWhileBusy, userJoined, userLeft, participantLeft, participantMediaState, peerConnected, peerDisconnected, peerClosed, webrtcError</p>
@@ -2022,6 +2024,15 @@ export interface TalkFlowClientEvents {
2022
2024
  * 발행된다(두 이벤트가 겹치지 않아 재동기화가 중복 실행되지 않는다).</p>
2023
2025
  */
2024
2026
  resumed: { reason: 'visibilitychange' | 'pageshow' | 'online' };
2027
+ /**
2028
+ * 회사 구독 없음 — 서버가 웹소켓 연결·구독·전송을 `NOT_SUBSCRIBED` 로 거부했다(결제 전·해지 회사). SDK 는 재연결하지 않고
2029
+ * 토큰도 거부된 것으로 기록하지 않는다(로그인·토큰 갱신은 그대로). 대기에 들어갈 때 한 번 발행되며 `connectionError` 는 내지 않는다.
2030
+ *
2031
+ * <p>앱: 파트너면 결제 화면, 그 밖은 «회사 구독이 필요합니다. 관리자에게 문의하세요.» 안내. 결제가 확인되면
2032
+ * (`subscription === 'ACTIVE'`) 같은 토큰으로 `connect()` 를 다시 부른다. 구독 확인 일시 실패(`SUBSCRIPTION_CHECK_UNAVAILABLE`)는
2033
+ * 이 이벤트가 아니다 — 평소처럼 재연결한다.</p>
2034
+ */
2035
+ subscriptionRequired: { code: 'NOT_SUBSCRIBED'; message: string };
2025
2036
  connectionError: unknown;
2026
2037
  tokenSet: { userId: string };
2027
2038
  loggedOut: void;
@@ -2679,6 +2690,8 @@ export default class TalkFlowClient implements SdkEventEmitter<TalkFlowClientEve
2679
2690
  /**
2680
2691
  * 연결 완료까지 기다립니다. 이전 연결의 자동 복구가 이어지는 동안 재시도 한도 소진으로 reject하지 않습니다.
2681
2692
  * 복구 연결 시 resolve하며, 명시적 disconnect·인증 종료·최초 연결 실패 시 reject합니다.
2693
+ * 회사 구독이 없으면(서버 `NOT_SUBSCRIBED`) `code: 'NOT_SUBSCRIBED'`·`type: 'SUBSCRIPTION_REQUIRED'` 로 reject 하고
2694
+ * 재연결하지 않습니다 — {@link TalkFlowClientEvents.subscriptionRequired} 참고.
2682
2695
  */
2683
2696
  connect(jwt?: string, options?: ConnectOptions): Promise<void>;
2684
2697
  disconnect(): Promise<void>;
@@ -2686,6 +2699,11 @@ export default class TalkFlowClient implements SdkEventEmitter<TalkFlowClientEve
2686
2699
  setToken(token: string): Promise<void>;
2687
2700
  updateToken(newToken: string): Promise<void>;
2688
2701
  isConnected(): boolean;
2702
+ /**
2703
+ * 회사 구독 대기 중인가 — 서버가 웹소켓을 `NOT_SUBSCRIBED` 로 거부해 연결을 멈췄다(결제 전·해지 회사).
2704
+ * 결제가 확인되면(`GET /api/v1/company/billing` 의 `subscription === 'ACTIVE'`) 같은 토큰으로 `connect()` 를 다시 부른다.
2705
+ */
2706
+ isSubscriptionRequired(): boolean;
2689
2707
  getState(): ConnectionStateValue;
2690
2708
  hasToken(): boolean;
2691
2709