@vibexnpm/talkx 3.0.0 → 3.0.2
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 +112 -0
- package/dist/talkflow-sdk.esm.js +1 -1
- package/dist/talkflow-sdk.esm.js.map +1 -1
- package/dist/talkflow-sdk.standalone.js +1 -1
- package/dist/talkflow-sdk.standalone.js.map +1 -1
- package/dist/talkflow-sdk.umd.js +1 -1
- package/dist/talkflow-sdk.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/chat/ChatClient.js +94 -0
- package/src/constants.js +2 -0
- package/src/talkflow/delegates.js +2 -0
- package/src/talkflow/eventForwarding.js +1 -0
- package/types/index.d.ts +112 -0
package/dist/index.d.ts
CHANGED
|
@@ -282,6 +282,106 @@ export interface TranslateToolRequest {
|
|
|
282
282
|
targetLang: string;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
// ── Rolling 누적 요약 (refreshSummary / getSummary / summaryUpdate) ──
|
|
286
|
+
|
|
287
|
+
/** {@link ChatClient.refreshSummary} 옵션. */
|
|
288
|
+
export interface RefreshSummaryOptions {
|
|
289
|
+
/** 요약 포맷 ({@link SummarizeFormat}). 미지정/알 수 없는 값이면 서버가 {@code SHORT} 적용. */
|
|
290
|
+
format?: SummarizeFormatValue;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* {@link ChatClient.refreshSummary} 반환 — 비동기 접수 결과(서버 {@code SummaryRefreshResult}).
|
|
295
|
+
* 실제 완료는 {@code summaryUpdate} 이벤트 + {@link ChatClient.getSummary} 로 확인한다.
|
|
296
|
+
*/
|
|
297
|
+
export interface RefreshSummaryResult {
|
|
298
|
+
/**
|
|
299
|
+
* <ul>
|
|
300
|
+
* <li>{@code 'STARTED'} — 요약 워커 시작됨({@code summaryUpdate} 대기).</li>
|
|
301
|
+
* <li>{@code 'ALREADY_RUNNING'} — 이미 진행 중(중복 트리거 — 재요청하지 말 것).</li>
|
|
302
|
+
* <li>{@code 'NO_CHANGE'} — 새 대화 없음(알림 발생 안 함; 직전 실패가 있었다면 자동 복구됨).</li>
|
|
303
|
+
* </ul>
|
|
304
|
+
*/
|
|
305
|
+
status: 'STARTED' | 'ALREADY_RUNNING' | 'NO_CHANGE';
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/** {@link ChatClient.getSummary} 옵션. */
|
|
309
|
+
export interface GetSummaryOptions {
|
|
310
|
+
/** 조회할 포맷({@link SummarizeFormat}). 미지정 시 기본(SHORT 우선). 미보유 포맷이면 rollup=null. */
|
|
311
|
+
format?: SummarizeFormatValue;
|
|
312
|
+
/** segment 페이지 커서(exclusive). 미지정 시 처음부터. */
|
|
313
|
+
afterSeq?: number;
|
|
314
|
+
/** segment 페이지 크기(서버 상한 50). */
|
|
315
|
+
size?: number;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** Rolling 누적 요약 통합본 — {@link RoomSummaryView.rollup}. */
|
|
319
|
+
export interface RoomSummaryRollup {
|
|
320
|
+
/** 요약 본문 ({@code format} 적용됨). */
|
|
321
|
+
content: string;
|
|
322
|
+
/** 적용된 포맷 ({@link SummarizeFormat} 소문자). */
|
|
323
|
+
format: string;
|
|
324
|
+
/** rollup 이 커버하는 가장 오래된 지점. */
|
|
325
|
+
coverStartAt: string | null;
|
|
326
|
+
/** 마지막으로 요약된 지점. */
|
|
327
|
+
watermarkAt: string | null;
|
|
328
|
+
/** 전체 segment 수(페이지 총량 힌트). */
|
|
329
|
+
segmentCount: number;
|
|
330
|
+
/** 이 포맷이 최신 대화를 아직 반영 안 함(reducedSegmentCount < segmentCount) — refreshSummary 로 최신화 가능. */
|
|
331
|
+
stale: boolean;
|
|
332
|
+
/** 진행 상태. {@code 'IDLE'}(완료/대기) | {@code 'RUNNING'}(요약 중) | {@code 'FAILED'}(실패). */
|
|
333
|
+
status: 'IDLE' | 'RUNNING' | 'FAILED';
|
|
334
|
+
/** 마지막 갱신 시각. */
|
|
335
|
+
updatedAt: string;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** Rolling 누적 요약 구간 부분요약 — {@link RoomSummaryView.segments} 항목. 항상 {@code contentFormat==='neutral'}. */
|
|
339
|
+
export interface RoomSummarySegment {
|
|
340
|
+
/** segment 순번(0부터). 페이지 커서. */
|
|
341
|
+
seq: number;
|
|
342
|
+
/** 구간 부분요약 본문. */
|
|
343
|
+
content: string;
|
|
344
|
+
/** 항상 {@code 'neutral'}(format 미적용). */
|
|
345
|
+
contentFormat: string;
|
|
346
|
+
fromSentAt: string | null;
|
|
347
|
+
fromMessageId: string | null;
|
|
348
|
+
toSentAt: string | null;
|
|
349
|
+
toMessageId: string | null;
|
|
350
|
+
/** 이 구간이 담은 메시지 수. */
|
|
351
|
+
messageCount: number;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* {@link ChatClient.getSummary} 반환 — 서버 {@code RoomSummaryView}.
|
|
356
|
+
* 아직 한 번도 요약되지 않았으면 {@code rollup} 이 {@code null} 이고 {@code segments} 는 빈 배열이다.
|
|
357
|
+
*/
|
|
358
|
+
export interface RoomSummaryView {
|
|
359
|
+
/** 요청/기본 포맷의 통합 요약본. 그 포맷으로 아직 요약 안 됐으면 null(availableFormats 로 다른 포맷 확인). */
|
|
360
|
+
rollup: RoomSummaryRollup | null;
|
|
361
|
+
/** 이 방이 보유한 포맷 목록(short/timeline/… — 탭 렌더용). */
|
|
362
|
+
availableFormats: string[];
|
|
363
|
+
/** 구간 부분요약 페이지(포맷 무관 공유). */
|
|
364
|
+
segments: RoomSummarySegment[];
|
|
365
|
+
/** 다음 segment 페이지 존재 여부. */
|
|
366
|
+
hasNext: boolean;
|
|
367
|
+
/** 다음 페이지 커서({@code getSummary} 의 {@code afterSeq} 로 사용). {@code hasNext === false} 면 null. */
|
|
368
|
+
nextSeq: number | null;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* {@code summaryUpdate} 이벤트 payload — Rolling 요약 완료/실패 통지(서버 {@code SummaryStreamEvent}).
|
|
373
|
+
* transient(저장 안 됨) — 확정 내용은 {@link ChatClient.getSummary} 로 읽는다.
|
|
374
|
+
*/
|
|
375
|
+
export interface SummaryUpdateEvent {
|
|
376
|
+
roomId: string;
|
|
377
|
+
/** {@code 'READY'}(갱신됨 → getSummary) | {@code 'FAILED'}(실패 → 재시도 가능) | {@code 'NO_CHANGE'}(변경 없음). */
|
|
378
|
+
status: 'READY' | 'NO_CHANGE' | 'FAILED';
|
|
379
|
+
/** 적용된 포맷. {@code READY} 만 포함, 그 외 null. */
|
|
380
|
+
format: string | null;
|
|
381
|
+
/** 갱신 시각. {@code READY} 만 포함, 그 외 null. */
|
|
382
|
+
updatedAt: string | null;
|
|
383
|
+
}
|
|
384
|
+
|
|
285
385
|
/**
|
|
286
386
|
* PM 프롬프트 레이어 — 서버 {@code PmPromptLayerResponse}.
|
|
287
387
|
*
|
|
@@ -1131,6 +1231,8 @@ export interface TalkFlowClientEvents {
|
|
|
1131
1231
|
messageRead: MessageReadEventPayload;
|
|
1132
1232
|
typing: TypingEvent;
|
|
1133
1233
|
assistantProgress: AssistantProgressEvent;
|
|
1234
|
+
/** Rolling 누적 요약 완료/실패 통지 (transient) — refreshSummary 후. */
|
|
1235
|
+
summaryUpdate: SummaryUpdateEvent;
|
|
1134
1236
|
memberJoined: MemberChangePayload;
|
|
1135
1237
|
memberLeft: MemberChangePayload;
|
|
1136
1238
|
roomSubscribed: { roomId: string };
|
|
@@ -1245,6 +1347,8 @@ export interface ChatClientEvents {
|
|
|
1245
1347
|
messageRead: MessageReadEventPayload;
|
|
1246
1348
|
typing: TypingEvent;
|
|
1247
1349
|
assistantProgress: AssistantProgressEvent;
|
|
1350
|
+
/** Rolling 누적 요약 완료/실패 통지 (transient) — refreshSummary 후. */
|
|
1351
|
+
summaryUpdate: SummaryUpdateEvent;
|
|
1248
1352
|
}
|
|
1249
1353
|
|
|
1250
1354
|
/**
|
|
@@ -1310,6 +1414,10 @@ export class ChatClient implements SdkEventEmitter<ChatClientEvents> {
|
|
|
1310
1414
|
summarizeWithAssistant(roomId: string, options: SummarizeToolRequest): Promise<AssistantToolResult>;
|
|
1311
1415
|
/** 특정 메시지 온디맨드 번역 (버튼 진입점, 동기, 요청자 전용 응답). */
|
|
1312
1416
|
translateWithAssistant(roomId: string, options: TranslateToolRequest): Promise<OnDemandTranslationResponse>;
|
|
1417
|
+
/** Rolling 누적 요약 갱신 트리거 (비동기). 완료는 {@code summaryUpdate} 이벤트 + {@link getSummary} 로 확인. */
|
|
1418
|
+
refreshSummary(roomId: string, options?: RefreshSummaryOptions): Promise<RefreshSummaryResult>;
|
|
1419
|
+
/** Rolling 누적 요약 조회 — rollup + segment 페이지. 저장된 요약의 단일 진실 소스. */
|
|
1420
|
+
getSummary(roomId: string, options?: GetSummaryOptions): Promise<RoomSummaryView>;
|
|
1313
1421
|
/** 방 PM 프롬프트 레이어 조회 — PM_BACKSTAGE 방 전용, 참여자 전체. 미등록 시 404. */
|
|
1314
1422
|
getRoomPmPrompt(roomId: string): Promise<PmPromptLayerResponse>;
|
|
1315
1423
|
/** 방 PM 프롬프트 레이어 등록/수정 (upsert, 새 버전 자동 기록) — 방 주인(OWNER) 전용. content 1~2,000자. */
|
|
@@ -1651,6 +1759,10 @@ export default class TalkFlowClient implements SdkEventEmitter<TalkFlowClientEve
|
|
|
1651
1759
|
summarizeWithAssistant(roomId: string, options: SummarizeToolRequest): Promise<AssistantToolResult>;
|
|
1652
1760
|
/** 특정 메시지 온디맨드 번역 (버튼 진입점, 동기, 요청자 전용 응답). */
|
|
1653
1761
|
translateWithAssistant(roomId: string, options: TranslateToolRequest): Promise<OnDemandTranslationResponse>;
|
|
1762
|
+
/** Rolling 누적 요약 갱신 트리거 (비동기). 완료는 {@code summaryUpdate} 이벤트 + {@link getSummary} 로 확인. */
|
|
1763
|
+
refreshSummary(roomId: string, options?: RefreshSummaryOptions): Promise<RefreshSummaryResult>;
|
|
1764
|
+
/** Rolling 누적 요약 조회 — rollup + segment 페이지. 저장된 요약의 단일 진실 소스. */
|
|
1765
|
+
getSummary(roomId: string, options?: GetSummaryOptions): Promise<RoomSummaryView>;
|
|
1654
1766
|
/** 방 PM 프롬프트 레이어 조회 — PM_BACKSTAGE 방 전용, 참여자 전체. 미등록 시 404. */
|
|
1655
1767
|
getRoomPmPrompt(roomId: string): Promise<PmPromptLayerResponse>;
|
|
1656
1768
|
/** 방 PM 프롬프트 레이어 등록/수정 (upsert, 새 버전 자동 기록) — 방 주인(OWNER) 전용. content 1~2,000자. */
|