@vibexnpm/talkx 5.3.0 → 5.6.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
@@ -327,16 +327,20 @@ export interface RefreshSummaryOptions {
327
327
  export interface RefreshSummaryResult {
328
328
  /**
329
329
  * <ul>
330
- * <li>{@code 'STARTED'} — 요약 워커 시작됨({@code summaryUpdate} 대기).</li>
331
- * <li>{@code 'ALREADY_RUNNING'} — 방에서 요약이 진행 중(<b>다른</b> 포맷·언어일 수 있음). {@code format}/{@code language}
332
- * 로 내 키인지 확인하고, {@code summaryUpdate} 가 내 키가 아니면 그때 다시 요청한다(무조건 재요청 금지 아님).</li>
333
- * <li>{@code 'NO_CHANGE'} — 새 대화 없음(알림 발생 안 함; 직전 실패가 있었다면 자동 복구됨).</li>
330
+ * <li>{@code 'QUEUED'} — 방 단위 durable work item 에 저장·병합됐다. pod 실행 슬롯이 포화여도
331
+ * 요청은 버려지지 않으며, 최종 {@code READY|NO_CHANGE|NO_MESSAGES|FAILED} {@code summaryUpdate} 를 기다린다.</li>
334
332
  * </ul>
333
+ *
334
+ * <p>durable 저장 자체가 실패하면 성공 결과가 아니라 <b>HTTP 503</b>
335
+ * ({@code SUMMARY_REFRESH_UNAVAILABLE})으로 오며, {@link ChatClient.refreshSummary} 가 reject 한다.</p>
336
+ *
337
+ * <p>⚠️ <b>닫힌 union 이 아니다</b>: 서버가 값을 추가할 수 있으므로 분기에는 반드시 default 를 둔다.
338
+ * 모르는 값을 {@code QUEUED} 로 가정하지 말고 별도 상태 확인 UI를 표시한다.</p>
335
339
  */
336
- status: 'STARTED' | 'ALREADY_RUNNING' | 'NO_CHANGE';
337
- /** 이번 요청이 해소한 포맷({@link SummarizeFormat} 소문자). 방 단위 경합 식별용. */
340
+ status: 'QUEUED' | (string & {});
341
+ /** durable work item 에 병합한 포맷({@link SummarizeFormat} 소문자). */
338
342
  format?: string;
339
- /** 이번 요청이 해소한 언어(소문자 BCP-47 / {@code 'OFF'}=원문). 방 단위 경합 식별용. */
343
+ /** durable work item 에 병합한 요청자 언어(소문자 BCP-47 / {@code 'OFF'}=원문). */
340
344
  language?: string;
341
345
  }
342
346
 
@@ -400,11 +404,15 @@ export interface RoomSummaryView {
400
404
  */
401
405
  language: string;
402
406
  /**
403
- * 방 전체 요약 프로세스 상태 — {@code 'IDLE'}(대기) | {@code 'RUNNING'}(요약 중) | {@code 'FAILED'}(실패).
404
- * <b>방 단위(키별 아님)</b>: 방은 한 번에 한 키만 요약하므로, 지금 다른 포맷·언어를 요약 중이어도 {@code 'RUNNING'} 이다.
405
- * 특정 rollup 의 최신 여부는 {@code rollup.stale} 로 판단한다(rollup 자체는 완료된 데이터). 요약 이력이 없으면 null.
407
+ * 실행 상태 — {@code 'QUEUED'}(durable 대기) | {@code 'IDLE'}(유휴) |
408
+ * {@code 'RUNNING'}(요약 중) | {@code 'FAILED'}(선택 키 실패) |
409
+ * {@code 'NO_MESSAGES'}(선택 키에 요약할 대화 없음).
410
+ * 대기/실행은 방 단위이고 terminal 결과는 조회한 포맷×언어 키 기준이다. 특정 rollup 의 최신 여부는
411
+ * {@code rollup.stale} 로 판단한다. 요약 이력이 없어도 durable job 상태가 있으면 null이 아닐 수 있다.
412
+ * 닫힌 union이 아니므로 분기에는 default를 둔다.
406
413
  */
407
- roomStatus: 'IDLE' | 'RUNNING' | 'FAILED' | null;
414
+ /** durable execution-plane 상태에서 합성되므로 재접속 뒤에도 복원된다. */
415
+ roomStatus: 'QUEUED' | 'IDLE' | 'RUNNING' | 'FAILED' | 'NO_MESSAGES' | (string & {}) | null;
408
416
  /** 요청/기본 포맷의 통합 요약본. 그 포맷×언어로 아직 요약 안 됐으면 null(availableFormats 로 같은 언어의 다른 포맷 확인). */
409
417
  rollup: RoomSummaryRollup | null;
410
418
  /** 이 방이 <b>이 언어로</b> 보유한 포맷 목록(short/timeline/… — 탭 렌더용). 타 언어는 포함하지 않는다. */
@@ -424,15 +432,18 @@ export interface RoomSummaryView {
424
432
  export interface SummaryUpdateEvent {
425
433
  roomId: string;
426
434
  /**
427
- * {@code 'READY'}(갱신됨 → getSummary) | {@code 'FAILED'}(실패 → 재시도 가능) | {@code 'NO_CHANGE'}(변경 없음) |
435
+ * {@code 'READY'}(갱신됨 → getSummary) | {@code 'FAILED'}(실패 → 재시도 가능) |
436
+ * {@code 'NO_CHANGE'}(변경 없이 durable 작업 종결 → getSummary로 최종 동기화) |
437
+ * {@code 'NO_MESSAGES'}(선택 키에 요약할 대화 없음) |
428
438
  * {@code 'INVALIDATED'}(방 원문 삭제/편집으로 요약이 통째로 버려짐 → 화면을 비우고 필요 시 refreshSummary 로 재생성).
439
+ * 닫힌 union이 아니므로 모르는 값은 추측하지 말고 one-shot getSummary로 재동기화한다.
429
440
  */
430
- status: 'READY' | 'NO_CHANGE' | 'FAILED' | 'INVALIDATED';
431
- /** 완료/실패한 포맷. {@code READY}·{@code FAILED} 포함, {@code NO_CHANGE}·{@code INVALIDATED} 는 null. */
441
+ status: 'READY' | 'NO_CHANGE' | 'NO_MESSAGES' | 'FAILED' | 'INVALIDATED' | (string & {});
442
+ /** 완료 포맷. {@code READY}·{@code NO_CHANGE}·{@code NO_MESSAGES}·{@code FAILED} 포함, {@code INVALIDATED} 는 null. */
432
443
  format: string | null;
433
444
  /**
434
- * fan-out 으로 한 번에 생성/최신화된 언어 목록(소문자 BCP-47 / {@code 'OFF'}). {@code READY}·{@code FAILED} 포함,
435
- * 그 외 null. 각 사용자는 자기 언어가 이 목록에 있으면 {@code getSummary({ format, lang })} 로 읽는다(§S1).
445
+ * fan-out 으로 한 번에 처리한 언어 목록(소문자 BCP-47 / {@code 'OFF'}).
446
+ * {@code READY}·{@code NO_CHANGE}·{@code NO_MESSAGES}·{@code FAILED} 포함, {@code INVALIDATED} 만 null.
436
447
  */
437
448
  languages: string[] | null;
438
449
  /** 갱신 시각(epoch millis). {@code READY} 만 포함, 그 외 null. */
@@ -951,6 +962,48 @@ export interface DecisionResponse {
951
962
  optionId: string;
952
963
  }
953
964
 
965
+ /** 로그인한 회원. `userId` 는 메시지 발신자 식별과 같은 값이다. */
966
+ export interface LoginMember {
967
+ userId: string;
968
+ email?: string | null;
969
+ nickname?: string | null;
970
+ profileUrl?: string | null;
971
+ preferredLanguage?: string | null;
972
+ }
973
+
974
+ /**
975
+ * `TalkFlowClient.loginUser` 응답.
976
+ *
977
+ * 회사 선택 단계가 없다 — 로그인 키가 전역 유일이라 이메일 하나로 회원과 회사가 함께 정해진다.
978
+ */
979
+ export interface LoginResult {
980
+ accessToken: string;
981
+ tokenType: string;
982
+ expiresIn?: number;
983
+ projectId: string;
984
+ /** 회사의 활성 ck- 키. SDK 초기화의 `apiKey` 로 그대로 넣는다. */
985
+ clientKey: string;
986
+ user: LoginMember;
987
+ }
988
+
989
+ /** 내 정보. 수정 응답에는 `accessToken` 이 함께 온다(name/profileUrl 이 토큰 claim). */
990
+ export interface MyProfile {
991
+ userId: string;
992
+ email?: string | null;
993
+ name?: string | null;
994
+ phone?: string | null;
995
+ profileUrl?: string | null;
996
+ /** 회사 역할 — 방 역할(ParticipantResponse.role)과 다른 축이다. */
997
+ companyRole: 'PARTNER' | 'MEMBER';
998
+ orgNodeId?: string | null;
999
+ orgName?: string | null;
1000
+ preferredLanguage?: string | null;
1001
+ projectId: string;
1002
+ joinedAt?: string | null;
1003
+ accessToken?: string;
1004
+ expiresIn?: number;
1005
+ }
1006
+
954
1007
  /** 채팅방 참가자. */
955
1008
  export interface ParticipantResponse {
956
1009
  userId: string;
@@ -2240,6 +2293,30 @@ export default class TalkFlowClient implements SdkEventEmitter<TalkFlowClientEve
2240
2293
  removeAllListeners(event?: keyof TalkFlowClientEvents): void;
2241
2294
  listenerCount(event: keyof TalkFlowClientEvents): number;
2242
2295
 
2296
+ // 회원 인증 · 내 정보
2297
+ /**
2298
+ * 회원 로그인 — 클라이언트 생성 **전에** 호출한다. Server Key 도 고객사 BFF 도 필요 없다.
2299
+ * 응답의 `clientKey`/`projectId`/`accessToken` 이 그대로 SDK 초기화 입력이다.
2300
+ * 회사 선택 단계가 없다 — 로그인 키가 전역 유일이다.
2301
+ */
2302
+ static loginUser(options: {
2303
+ serverUrl: string;
2304
+ email: string;
2305
+ password: string;
2306
+ }): Promise<LoginResult>;
2307
+
2308
+ /** 회원 로그인 (인스턴스) — 재로그인·계정 전환용. 성공 시 토큰을 자동 설정한다. */
2309
+ loginUser(credentials: { email: string; password: string }): Promise<LoginResult>;
2310
+
2311
+ /** 내 정보 조회. */
2312
+ getMyProfile(): Promise<MyProfile>;
2313
+
2314
+ /** 내 정보 수정 — 응답의 새 토큰을 자동 채택한다(name/profileUrl 이 토큰 claim). */
2315
+ updateMyProfile(profile: { name?: string; phone?: string; profileUrl?: string }): Promise<MyProfile>;
2316
+
2317
+ /** 비밀번호 변경 — 현재 비밀번호 재확인. 토큰은 그대로 유효해 재로그인이 필요 없다. */
2318
+ changeMyPassword(params: { currentPassword: string; newPassword: string }): Promise<unknown>;
2319
+
2243
2320
  // Connection lifecycle
2244
2321
  connect(jwt?: string, options?: ConnectOptions): Promise<void>;
2245
2322
  disconnect(): Promise<void>;