connectbase-client 3.17.2 → 3.19.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/CHANGELOG.md +39 -0
- package/README.md +5 -0
- package/dist/connect-base.umd.js +4 -4
- package/dist/index.d.mts +103 -1
- package/dist/index.d.ts +103 -1
- package/dist/index.js +63 -0
- package/dist/index.mjs +63 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6952,7 +6952,33 @@ interface CreateDocumentRequest {
|
|
|
6952
6952
|
* 비어있으면 서버가 매직 바이트로 자동 추정 — 정확도를 위해 명시 권장.
|
|
6953
6953
|
*/
|
|
6954
6954
|
mime_type?: string;
|
|
6955
|
+
/**
|
|
6956
|
+
* 클라이언트가 지정하는 멱등(upsert) 키. 같은 지식 베이스 안에서 유일하다.
|
|
6957
|
+
* 같은 `external_id` 로 다시 `addDocument` 하면 새 문서를 만들지 않고 기존 문서를
|
|
6958
|
+
* 교체(update)한다 — `listDocuments` 로 기존 문서를 찾아 지울 필요 없이
|
|
6959
|
+
* idempotent 한 동기화가 가능하다. 문서 id 도 그대로 유지된다.
|
|
6960
|
+
*/
|
|
6961
|
+
external_id?: string;
|
|
6962
|
+
metadata?: Record<string, unknown>;
|
|
6963
|
+
}
|
|
6964
|
+
/**
|
|
6965
|
+
* 문서 update/upsert 요청. 보낸 필드만 교체된다 (생략한 필드는 변경 없음).
|
|
6966
|
+
*
|
|
6967
|
+
* `content` / `file_content` / `metadata` 중 하나라도 보내면 서버가 전체 재색인을 수행한다
|
|
6968
|
+
* (기존 청크 삭제 → 재청킹 → 재색인). RAG 특성상 콘텐츠가 바뀌면 청크 경계가 바뀌어
|
|
6969
|
+
* 부분 수정이 불가능하며, 재색인 시 색인 토큰이 다시 과금된다.
|
|
6970
|
+
* `name` / `external_id` 만 보내면 재색인 없이 라벨·멱등 키만 변경된다.
|
|
6971
|
+
* 문서 id 는 항상 유지되므로 검색 결과의 `document_id` 참조가 깨지지 않는다.
|
|
6972
|
+
*/
|
|
6973
|
+
interface UpdateDocumentRequest {
|
|
6974
|
+
name?: string;
|
|
6975
|
+
content?: string;
|
|
6976
|
+
/** base64 인코딩 파일 (파일 재업로드, PDF/DOCX/text). content 보다 우선하며 source_type 무관하게 추출. */
|
|
6977
|
+
file_content?: string;
|
|
6978
|
+
/** file_content 의 MIME. 비어있으면 서버 자동 추정. */
|
|
6979
|
+
mime_type?: string;
|
|
6955
6980
|
metadata?: Record<string, unknown>;
|
|
6981
|
+
external_id?: string;
|
|
6956
6982
|
}
|
|
6957
6983
|
interface DocumentResponse {
|
|
6958
6984
|
id: string;
|
|
@@ -6960,6 +6986,7 @@ interface DocumentResponse {
|
|
|
6960
6986
|
source_type: string;
|
|
6961
6987
|
mime_type?: string;
|
|
6962
6988
|
source_url?: string;
|
|
6989
|
+
external_id?: string;
|
|
6963
6990
|
file_size: number;
|
|
6964
6991
|
chunk_count: number;
|
|
6965
6992
|
status: 'pending' | 'processing' | 'ready' | 'failed';
|
|
@@ -7018,6 +7045,14 @@ interface KnowledgeSearchResponse {
|
|
|
7018
7045
|
query: string;
|
|
7019
7046
|
results: KnowledgeSearchResult[];
|
|
7020
7047
|
total: number;
|
|
7048
|
+
/**
|
|
7049
|
+
* 이 응답이 agentic 다중검색으로 생성됐는지 여부. `agentic: true` 를 보냈더라도
|
|
7050
|
+
* AI provider 미설정·LLM 오류로 단일 키워드 검색에 폴백되면 `false` — 옵션이
|
|
7051
|
+
* placebo 가 되지 않도록 실제 수행 여부를 신호한다.
|
|
7052
|
+
*/
|
|
7053
|
+
agentic?: boolean;
|
|
7054
|
+
/** 수행된 agentic 검색 라운드 수 (1~2). 0 또는 미존재는 폴백을 의미. */
|
|
7055
|
+
agentic_rounds?: number;
|
|
7021
7056
|
}
|
|
7022
7057
|
|
|
7023
7058
|
/**
|
|
@@ -7096,9 +7131,60 @@ declare class KnowledgeAPI {
|
|
|
7096
7131
|
* source_type: 'url',
|
|
7097
7132
|
* source_url: 'https://example.com/help.html'
|
|
7098
7133
|
* })
|
|
7134
|
+
*
|
|
7135
|
+
* // external_id 로 idempotent 동기화 (빌드 스크립트 등)
|
|
7136
|
+
* // 같은 external_id 로 다시 호출하면 기존 문서를 교체한다 (문서 id 유지).
|
|
7137
|
+
* await cb.knowledge.addDocument('kb-id', {
|
|
7138
|
+
* name: '블로그: 제목',
|
|
7139
|
+
* source_type: 'text',
|
|
7140
|
+
* content: '...',
|
|
7141
|
+
* external_id: 'blog/my-post-slug',
|
|
7142
|
+
* })
|
|
7099
7143
|
* ```
|
|
7100
7144
|
*/
|
|
7101
7145
|
addDocument(kbID: string, data: CreateDocumentRequest): Promise<DocumentResponse>;
|
|
7146
|
+
/**
|
|
7147
|
+
* 문서 수정 (update/upsert)
|
|
7148
|
+
*
|
|
7149
|
+
* 기존 문서의 내용·이름·메타데이터를 교체합니다. **문서 id 는 그대로 유지**되므로
|
|
7150
|
+
* 검색 결과의 `document_id` 를 외부에서 참조(인용·캐시)해도 편집 후 깨지지 않습니다.
|
|
7151
|
+
* 보낸 필드만 교체되며, 내용/이름/메타데이터가 실제로 바뀌면 자동으로 재청킹·재색인됩니다.
|
|
7152
|
+
*
|
|
7153
|
+
* @param kbID - 지식 베이스 ID
|
|
7154
|
+
* @param docID - 문서 ID
|
|
7155
|
+
* @param data - 변경할 필드 (생략한 필드는 변경 없음)
|
|
7156
|
+
* @returns 수정된 문서 정보
|
|
7157
|
+
*
|
|
7158
|
+
* @example
|
|
7159
|
+
* ```typescript
|
|
7160
|
+
* // 내용만 교체 — document_id 는 그대로
|
|
7161
|
+
* const doc = await cb.knowledge.updateDocument('kb-id', 'doc-id', {
|
|
7162
|
+
* content: '갱신된 환불 정책...',
|
|
7163
|
+
* })
|
|
7164
|
+
*
|
|
7165
|
+
* // 이름 + 메타데이터 교체
|
|
7166
|
+
* await cb.knowledge.updateDocument('kb-id', 'doc-id', {
|
|
7167
|
+
* name: 'FAQ (2026)',
|
|
7168
|
+
* metadata: { tag: 'faq', updated: '2026-05' },
|
|
7169
|
+
* })
|
|
7170
|
+
* ```
|
|
7171
|
+
*/
|
|
7172
|
+
updateDocument(kbID: string, docID: string, data: UpdateDocumentRequest): Promise<DocumentResponse>;
|
|
7173
|
+
/**
|
|
7174
|
+
* 파일로 문서 수정 (PDF / DOCX / text 파일 재업로드).
|
|
7175
|
+
*
|
|
7176
|
+
* [`addDocumentFromFile`](#addDocumentFromFile) 의 update 버전. 문서 id 는 유지됩니다.
|
|
7177
|
+
*
|
|
7178
|
+
* @param kbID - Knowledge Base ID
|
|
7179
|
+
* @param docID - 문서 ID
|
|
7180
|
+
* @param file - 새 파일. `File` (DOM) / `Blob` / `{ data, mimeType, name }` (Node) 모두 가능
|
|
7181
|
+
* @param options - name / metadata 오버라이드
|
|
7182
|
+
* @returns 수정된 문서 정보
|
|
7183
|
+
*/
|
|
7184
|
+
updateDocumentFromFile(kbID: string, docID: string, file: KnowledgeFileInput, options?: {
|
|
7185
|
+
name?: string;
|
|
7186
|
+
metadata?: Record<string, unknown>;
|
|
7187
|
+
}): Promise<DocumentResponse>;
|
|
7102
7188
|
/**
|
|
7103
7189
|
* 파일을 KB 에 추가 (PDF / DOCX / text 파일).
|
|
7104
7190
|
*
|
|
@@ -7243,6 +7329,11 @@ interface AISource {
|
|
|
7243
7329
|
}
|
|
7244
7330
|
interface AIChatResponse {
|
|
7245
7331
|
content: string;
|
|
7332
|
+
/**
|
|
7333
|
+
* 추론 모델(Qwen3 reasoning, OpenAI o-series, DeepSeek-R1 등)의 사고 과정.
|
|
7334
|
+
* 최종 답변(`content`)과 분리되어 제공됩니다. 추론 모델이 아니면 비어 있습니다.
|
|
7335
|
+
*/
|
|
7336
|
+
reasoning?: string;
|
|
7246
7337
|
finishReason?: string;
|
|
7247
7338
|
usage?: {
|
|
7248
7339
|
promptTokens: number;
|
|
@@ -7257,6 +7348,11 @@ interface AIChatResponse {
|
|
|
7257
7348
|
interface AIStreamChunk {
|
|
7258
7349
|
type?: 'sources' | 'token' | 'searching' | 'tool_start' | 'tool_end' | 'heartbeat';
|
|
7259
7350
|
content: string;
|
|
7351
|
+
/**
|
|
7352
|
+
* 추론 모델의 사고 과정 델타. 추론 구간의 청크는 `content`가 비어 있고
|
|
7353
|
+
* `reasoning`만 채워져 전달됩니다.
|
|
7354
|
+
*/
|
|
7355
|
+
reasoning?: string;
|
|
7260
7356
|
finishReason?: string;
|
|
7261
7357
|
done: boolean;
|
|
7262
7358
|
toolCalls?: AIToolCall[];
|
|
@@ -7310,6 +7406,7 @@ declare class AIAPI {
|
|
|
7310
7406
|
* knowledgeBaseId: 'kb-id',
|
|
7311
7407
|
* }, {
|
|
7312
7408
|
* onSources: (sources) => console.log('참조:', sources),
|
|
7409
|
+
* onReasoning: (reasoning) => process.stdout.write(reasoning),
|
|
7313
7410
|
* onToken: (content) => process.stdout.write(content),
|
|
7314
7411
|
* onDone: () => console.log('\\n완료'),
|
|
7315
7412
|
* onError: (error) => console.error('에러:', error)
|
|
@@ -7318,6 +7415,11 @@ declare class AIAPI {
|
|
|
7318
7415
|
*/
|
|
7319
7416
|
chatStream(request: AIChatRequest, callbacks: {
|
|
7320
7417
|
onSources?: (sources: AISource[]) => void;
|
|
7418
|
+
/**
|
|
7419
|
+
* 추론 모델의 사고 과정 델타. 추론 모델(Qwen3 reasoning, o-series 등)을
|
|
7420
|
+
* 사용할 때만 호출되며, 최종 답변은 `onToken`으로 별도 전달됩니다.
|
|
7421
|
+
*/
|
|
7422
|
+
onReasoning?: (reasoning: string) => void;
|
|
7321
7423
|
onToken?: (content: string) => void;
|
|
7322
7424
|
onToolEvent?: (event: AIToolEvent) => void;
|
|
7323
7425
|
onDone?: () => void;
|
|
@@ -8436,4 +8538,4 @@ declare class ConnectBase {
|
|
|
8436
8538
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
8437
8539
|
}
|
|
8438
8540
|
|
|
8439
|
-
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStaleMessage, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported, toCreateRoomWire };
|
|
8541
|
+
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStaleMessage, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported, toCreateRoomWire };
|
package/dist/index.d.ts
CHANGED
|
@@ -6952,7 +6952,33 @@ interface CreateDocumentRequest {
|
|
|
6952
6952
|
* 비어있으면 서버가 매직 바이트로 자동 추정 — 정확도를 위해 명시 권장.
|
|
6953
6953
|
*/
|
|
6954
6954
|
mime_type?: string;
|
|
6955
|
+
/**
|
|
6956
|
+
* 클라이언트가 지정하는 멱등(upsert) 키. 같은 지식 베이스 안에서 유일하다.
|
|
6957
|
+
* 같은 `external_id` 로 다시 `addDocument` 하면 새 문서를 만들지 않고 기존 문서를
|
|
6958
|
+
* 교체(update)한다 — `listDocuments` 로 기존 문서를 찾아 지울 필요 없이
|
|
6959
|
+
* idempotent 한 동기화가 가능하다. 문서 id 도 그대로 유지된다.
|
|
6960
|
+
*/
|
|
6961
|
+
external_id?: string;
|
|
6962
|
+
metadata?: Record<string, unknown>;
|
|
6963
|
+
}
|
|
6964
|
+
/**
|
|
6965
|
+
* 문서 update/upsert 요청. 보낸 필드만 교체된다 (생략한 필드는 변경 없음).
|
|
6966
|
+
*
|
|
6967
|
+
* `content` / `file_content` / `metadata` 중 하나라도 보내면 서버가 전체 재색인을 수행한다
|
|
6968
|
+
* (기존 청크 삭제 → 재청킹 → 재색인). RAG 특성상 콘텐츠가 바뀌면 청크 경계가 바뀌어
|
|
6969
|
+
* 부분 수정이 불가능하며, 재색인 시 색인 토큰이 다시 과금된다.
|
|
6970
|
+
* `name` / `external_id` 만 보내면 재색인 없이 라벨·멱등 키만 변경된다.
|
|
6971
|
+
* 문서 id 는 항상 유지되므로 검색 결과의 `document_id` 참조가 깨지지 않는다.
|
|
6972
|
+
*/
|
|
6973
|
+
interface UpdateDocumentRequest {
|
|
6974
|
+
name?: string;
|
|
6975
|
+
content?: string;
|
|
6976
|
+
/** base64 인코딩 파일 (파일 재업로드, PDF/DOCX/text). content 보다 우선하며 source_type 무관하게 추출. */
|
|
6977
|
+
file_content?: string;
|
|
6978
|
+
/** file_content 의 MIME. 비어있으면 서버 자동 추정. */
|
|
6979
|
+
mime_type?: string;
|
|
6955
6980
|
metadata?: Record<string, unknown>;
|
|
6981
|
+
external_id?: string;
|
|
6956
6982
|
}
|
|
6957
6983
|
interface DocumentResponse {
|
|
6958
6984
|
id: string;
|
|
@@ -6960,6 +6986,7 @@ interface DocumentResponse {
|
|
|
6960
6986
|
source_type: string;
|
|
6961
6987
|
mime_type?: string;
|
|
6962
6988
|
source_url?: string;
|
|
6989
|
+
external_id?: string;
|
|
6963
6990
|
file_size: number;
|
|
6964
6991
|
chunk_count: number;
|
|
6965
6992
|
status: 'pending' | 'processing' | 'ready' | 'failed';
|
|
@@ -7018,6 +7045,14 @@ interface KnowledgeSearchResponse {
|
|
|
7018
7045
|
query: string;
|
|
7019
7046
|
results: KnowledgeSearchResult[];
|
|
7020
7047
|
total: number;
|
|
7048
|
+
/**
|
|
7049
|
+
* 이 응답이 agentic 다중검색으로 생성됐는지 여부. `agentic: true` 를 보냈더라도
|
|
7050
|
+
* AI provider 미설정·LLM 오류로 단일 키워드 검색에 폴백되면 `false` — 옵션이
|
|
7051
|
+
* placebo 가 되지 않도록 실제 수행 여부를 신호한다.
|
|
7052
|
+
*/
|
|
7053
|
+
agentic?: boolean;
|
|
7054
|
+
/** 수행된 agentic 검색 라운드 수 (1~2). 0 또는 미존재는 폴백을 의미. */
|
|
7055
|
+
agentic_rounds?: number;
|
|
7021
7056
|
}
|
|
7022
7057
|
|
|
7023
7058
|
/**
|
|
@@ -7096,9 +7131,60 @@ declare class KnowledgeAPI {
|
|
|
7096
7131
|
* source_type: 'url',
|
|
7097
7132
|
* source_url: 'https://example.com/help.html'
|
|
7098
7133
|
* })
|
|
7134
|
+
*
|
|
7135
|
+
* // external_id 로 idempotent 동기화 (빌드 스크립트 등)
|
|
7136
|
+
* // 같은 external_id 로 다시 호출하면 기존 문서를 교체한다 (문서 id 유지).
|
|
7137
|
+
* await cb.knowledge.addDocument('kb-id', {
|
|
7138
|
+
* name: '블로그: 제목',
|
|
7139
|
+
* source_type: 'text',
|
|
7140
|
+
* content: '...',
|
|
7141
|
+
* external_id: 'blog/my-post-slug',
|
|
7142
|
+
* })
|
|
7099
7143
|
* ```
|
|
7100
7144
|
*/
|
|
7101
7145
|
addDocument(kbID: string, data: CreateDocumentRequest): Promise<DocumentResponse>;
|
|
7146
|
+
/**
|
|
7147
|
+
* 문서 수정 (update/upsert)
|
|
7148
|
+
*
|
|
7149
|
+
* 기존 문서의 내용·이름·메타데이터를 교체합니다. **문서 id 는 그대로 유지**되므로
|
|
7150
|
+
* 검색 결과의 `document_id` 를 외부에서 참조(인용·캐시)해도 편집 후 깨지지 않습니다.
|
|
7151
|
+
* 보낸 필드만 교체되며, 내용/이름/메타데이터가 실제로 바뀌면 자동으로 재청킹·재색인됩니다.
|
|
7152
|
+
*
|
|
7153
|
+
* @param kbID - 지식 베이스 ID
|
|
7154
|
+
* @param docID - 문서 ID
|
|
7155
|
+
* @param data - 변경할 필드 (생략한 필드는 변경 없음)
|
|
7156
|
+
* @returns 수정된 문서 정보
|
|
7157
|
+
*
|
|
7158
|
+
* @example
|
|
7159
|
+
* ```typescript
|
|
7160
|
+
* // 내용만 교체 — document_id 는 그대로
|
|
7161
|
+
* const doc = await cb.knowledge.updateDocument('kb-id', 'doc-id', {
|
|
7162
|
+
* content: '갱신된 환불 정책...',
|
|
7163
|
+
* })
|
|
7164
|
+
*
|
|
7165
|
+
* // 이름 + 메타데이터 교체
|
|
7166
|
+
* await cb.knowledge.updateDocument('kb-id', 'doc-id', {
|
|
7167
|
+
* name: 'FAQ (2026)',
|
|
7168
|
+
* metadata: { tag: 'faq', updated: '2026-05' },
|
|
7169
|
+
* })
|
|
7170
|
+
* ```
|
|
7171
|
+
*/
|
|
7172
|
+
updateDocument(kbID: string, docID: string, data: UpdateDocumentRequest): Promise<DocumentResponse>;
|
|
7173
|
+
/**
|
|
7174
|
+
* 파일로 문서 수정 (PDF / DOCX / text 파일 재업로드).
|
|
7175
|
+
*
|
|
7176
|
+
* [`addDocumentFromFile`](#addDocumentFromFile) 의 update 버전. 문서 id 는 유지됩니다.
|
|
7177
|
+
*
|
|
7178
|
+
* @param kbID - Knowledge Base ID
|
|
7179
|
+
* @param docID - 문서 ID
|
|
7180
|
+
* @param file - 새 파일. `File` (DOM) / `Blob` / `{ data, mimeType, name }` (Node) 모두 가능
|
|
7181
|
+
* @param options - name / metadata 오버라이드
|
|
7182
|
+
* @returns 수정된 문서 정보
|
|
7183
|
+
*/
|
|
7184
|
+
updateDocumentFromFile(kbID: string, docID: string, file: KnowledgeFileInput, options?: {
|
|
7185
|
+
name?: string;
|
|
7186
|
+
metadata?: Record<string, unknown>;
|
|
7187
|
+
}): Promise<DocumentResponse>;
|
|
7102
7188
|
/**
|
|
7103
7189
|
* 파일을 KB 에 추가 (PDF / DOCX / text 파일).
|
|
7104
7190
|
*
|
|
@@ -7243,6 +7329,11 @@ interface AISource {
|
|
|
7243
7329
|
}
|
|
7244
7330
|
interface AIChatResponse {
|
|
7245
7331
|
content: string;
|
|
7332
|
+
/**
|
|
7333
|
+
* 추론 모델(Qwen3 reasoning, OpenAI o-series, DeepSeek-R1 등)의 사고 과정.
|
|
7334
|
+
* 최종 답변(`content`)과 분리되어 제공됩니다. 추론 모델이 아니면 비어 있습니다.
|
|
7335
|
+
*/
|
|
7336
|
+
reasoning?: string;
|
|
7246
7337
|
finishReason?: string;
|
|
7247
7338
|
usage?: {
|
|
7248
7339
|
promptTokens: number;
|
|
@@ -7257,6 +7348,11 @@ interface AIChatResponse {
|
|
|
7257
7348
|
interface AIStreamChunk {
|
|
7258
7349
|
type?: 'sources' | 'token' | 'searching' | 'tool_start' | 'tool_end' | 'heartbeat';
|
|
7259
7350
|
content: string;
|
|
7351
|
+
/**
|
|
7352
|
+
* 추론 모델의 사고 과정 델타. 추론 구간의 청크는 `content`가 비어 있고
|
|
7353
|
+
* `reasoning`만 채워져 전달됩니다.
|
|
7354
|
+
*/
|
|
7355
|
+
reasoning?: string;
|
|
7260
7356
|
finishReason?: string;
|
|
7261
7357
|
done: boolean;
|
|
7262
7358
|
toolCalls?: AIToolCall[];
|
|
@@ -7310,6 +7406,7 @@ declare class AIAPI {
|
|
|
7310
7406
|
* knowledgeBaseId: 'kb-id',
|
|
7311
7407
|
* }, {
|
|
7312
7408
|
* onSources: (sources) => console.log('참조:', sources),
|
|
7409
|
+
* onReasoning: (reasoning) => process.stdout.write(reasoning),
|
|
7313
7410
|
* onToken: (content) => process.stdout.write(content),
|
|
7314
7411
|
* onDone: () => console.log('\\n완료'),
|
|
7315
7412
|
* onError: (error) => console.error('에러:', error)
|
|
@@ -7318,6 +7415,11 @@ declare class AIAPI {
|
|
|
7318
7415
|
*/
|
|
7319
7416
|
chatStream(request: AIChatRequest, callbacks: {
|
|
7320
7417
|
onSources?: (sources: AISource[]) => void;
|
|
7418
|
+
/**
|
|
7419
|
+
* 추론 모델의 사고 과정 델타. 추론 모델(Qwen3 reasoning, o-series 등)을
|
|
7420
|
+
* 사용할 때만 호출되며, 최종 답변은 `onToken`으로 별도 전달됩니다.
|
|
7421
|
+
*/
|
|
7422
|
+
onReasoning?: (reasoning: string) => void;
|
|
7321
7423
|
onToken?: (content: string) => void;
|
|
7322
7424
|
onToolEvent?: (event: AIToolEvent) => void;
|
|
7323
7425
|
onDone?: () => void;
|
|
@@ -8436,4 +8538,4 @@ declare class ConnectBase {
|
|
|
8436
8538
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
8437
8539
|
}
|
|
8438
8540
|
|
|
8439
|
-
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStaleMessage, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported, toCreateRoomWire };
|
|
8541
|
+
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type Channel, type ChannelMembership, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GeoWithin, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type GuestMemberSignInResponse, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoomInfo, type RoomStaleMessage, type RoomStats, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, isWebTransportSupported, toCreateRoomWire };
|
package/dist/index.js
CHANGED
|
@@ -8050,6 +8050,15 @@ var KnowledgeAPI = class {
|
|
|
8050
8050
|
* source_type: 'url',
|
|
8051
8051
|
* source_url: 'https://example.com/help.html'
|
|
8052
8052
|
* })
|
|
8053
|
+
*
|
|
8054
|
+
* // external_id 로 idempotent 동기화 (빌드 스크립트 등)
|
|
8055
|
+
* // 같은 external_id 로 다시 호출하면 기존 문서를 교체한다 (문서 id 유지).
|
|
8056
|
+
* await cb.knowledge.addDocument('kb-id', {
|
|
8057
|
+
* name: '블로그: 제목',
|
|
8058
|
+
* source_type: 'text',
|
|
8059
|
+
* content: '...',
|
|
8060
|
+
* external_id: 'blog/my-post-slug',
|
|
8061
|
+
* })
|
|
8053
8062
|
* ```
|
|
8054
8063
|
*/
|
|
8055
8064
|
async addDocument(kbID, data) {
|
|
@@ -8058,6 +8067,58 @@ var KnowledgeAPI = class {
|
|
|
8058
8067
|
data
|
|
8059
8068
|
);
|
|
8060
8069
|
}
|
|
8070
|
+
/**
|
|
8071
|
+
* 문서 수정 (update/upsert)
|
|
8072
|
+
*
|
|
8073
|
+
* 기존 문서의 내용·이름·메타데이터를 교체합니다. **문서 id 는 그대로 유지**되므로
|
|
8074
|
+
* 검색 결과의 `document_id` 를 외부에서 참조(인용·캐시)해도 편집 후 깨지지 않습니다.
|
|
8075
|
+
* 보낸 필드만 교체되며, 내용/이름/메타데이터가 실제로 바뀌면 자동으로 재청킹·재색인됩니다.
|
|
8076
|
+
*
|
|
8077
|
+
* @param kbID - 지식 베이스 ID
|
|
8078
|
+
* @param docID - 문서 ID
|
|
8079
|
+
* @param data - 변경할 필드 (생략한 필드는 변경 없음)
|
|
8080
|
+
* @returns 수정된 문서 정보
|
|
8081
|
+
*
|
|
8082
|
+
* @example
|
|
8083
|
+
* ```typescript
|
|
8084
|
+
* // 내용만 교체 — document_id 는 그대로
|
|
8085
|
+
* const doc = await cb.knowledge.updateDocument('kb-id', 'doc-id', {
|
|
8086
|
+
* content: '갱신된 환불 정책...',
|
|
8087
|
+
* })
|
|
8088
|
+
*
|
|
8089
|
+
* // 이름 + 메타데이터 교체
|
|
8090
|
+
* await cb.knowledge.updateDocument('kb-id', 'doc-id', {
|
|
8091
|
+
* name: 'FAQ (2026)',
|
|
8092
|
+
* metadata: { tag: 'faq', updated: '2026-05' },
|
|
8093
|
+
* })
|
|
8094
|
+
* ```
|
|
8095
|
+
*/
|
|
8096
|
+
async updateDocument(kbID, docID, data) {
|
|
8097
|
+
return this.http.put(
|
|
8098
|
+
`/v1/public/knowledge-bases/${kbID}/documents/${docID}`,
|
|
8099
|
+
data
|
|
8100
|
+
);
|
|
8101
|
+
}
|
|
8102
|
+
/**
|
|
8103
|
+
* 파일로 문서 수정 (PDF / DOCX / text 파일 재업로드).
|
|
8104
|
+
*
|
|
8105
|
+
* [`addDocumentFromFile`](#addDocumentFromFile) 의 update 버전. 문서 id 는 유지됩니다.
|
|
8106
|
+
*
|
|
8107
|
+
* @param kbID - Knowledge Base ID
|
|
8108
|
+
* @param docID - 문서 ID
|
|
8109
|
+
* @param file - 새 파일. `File` (DOM) / `Blob` / `{ data, mimeType, name }` (Node) 모두 가능
|
|
8110
|
+
* @param options - name / metadata 오버라이드
|
|
8111
|
+
* @returns 수정된 문서 정보
|
|
8112
|
+
*/
|
|
8113
|
+
async updateDocumentFromFile(kbID, docID, file, options) {
|
|
8114
|
+
const { data, mimeType } = await readFileInput(file);
|
|
8115
|
+
return this.updateDocument(kbID, docID, {
|
|
8116
|
+
name: options?.name,
|
|
8117
|
+
file_content: data,
|
|
8118
|
+
mime_type: mimeType,
|
|
8119
|
+
metadata: options?.metadata
|
|
8120
|
+
});
|
|
8121
|
+
}
|
|
8061
8122
|
/**
|
|
8062
8123
|
* 파일을 KB 에 추가 (PDF / DOCX / text 파일).
|
|
8063
8124
|
*
|
|
@@ -8202,6 +8263,7 @@ var AIAPI = class {
|
|
|
8202
8263
|
* knowledgeBaseId: 'kb-id',
|
|
8203
8264
|
* }, {
|
|
8204
8265
|
* onSources: (sources) => console.log('참조:', sources),
|
|
8266
|
+
* onReasoning: (reasoning) => process.stdout.write(reasoning),
|
|
8205
8267
|
* onToken: (content) => process.stdout.write(content),
|
|
8206
8268
|
* onDone: () => console.log('\\n완료'),
|
|
8207
8269
|
* onError: (error) => console.error('에러:', error)
|
|
@@ -8263,6 +8325,7 @@ var AIAPI = class {
|
|
|
8263
8325
|
if (event.type === "heartbeat" || event.type === "searching") {
|
|
8264
8326
|
continue;
|
|
8265
8327
|
}
|
|
8328
|
+
if (event.reasoning) callbacks.onReasoning?.(event.reasoning);
|
|
8266
8329
|
if (event.content) callbacks.onToken?.(event.content);
|
|
8267
8330
|
if (event.done) {
|
|
8268
8331
|
callbacks.onDone?.();
|
package/dist/index.mjs
CHANGED
|
@@ -8007,6 +8007,15 @@ var KnowledgeAPI = class {
|
|
|
8007
8007
|
* source_type: 'url',
|
|
8008
8008
|
* source_url: 'https://example.com/help.html'
|
|
8009
8009
|
* })
|
|
8010
|
+
*
|
|
8011
|
+
* // external_id 로 idempotent 동기화 (빌드 스크립트 등)
|
|
8012
|
+
* // 같은 external_id 로 다시 호출하면 기존 문서를 교체한다 (문서 id 유지).
|
|
8013
|
+
* await cb.knowledge.addDocument('kb-id', {
|
|
8014
|
+
* name: '블로그: 제목',
|
|
8015
|
+
* source_type: 'text',
|
|
8016
|
+
* content: '...',
|
|
8017
|
+
* external_id: 'blog/my-post-slug',
|
|
8018
|
+
* })
|
|
8010
8019
|
* ```
|
|
8011
8020
|
*/
|
|
8012
8021
|
async addDocument(kbID, data) {
|
|
@@ -8015,6 +8024,58 @@ var KnowledgeAPI = class {
|
|
|
8015
8024
|
data
|
|
8016
8025
|
);
|
|
8017
8026
|
}
|
|
8027
|
+
/**
|
|
8028
|
+
* 문서 수정 (update/upsert)
|
|
8029
|
+
*
|
|
8030
|
+
* 기존 문서의 내용·이름·메타데이터를 교체합니다. **문서 id 는 그대로 유지**되므로
|
|
8031
|
+
* 검색 결과의 `document_id` 를 외부에서 참조(인용·캐시)해도 편집 후 깨지지 않습니다.
|
|
8032
|
+
* 보낸 필드만 교체되며, 내용/이름/메타데이터가 실제로 바뀌면 자동으로 재청킹·재색인됩니다.
|
|
8033
|
+
*
|
|
8034
|
+
* @param kbID - 지식 베이스 ID
|
|
8035
|
+
* @param docID - 문서 ID
|
|
8036
|
+
* @param data - 변경할 필드 (생략한 필드는 변경 없음)
|
|
8037
|
+
* @returns 수정된 문서 정보
|
|
8038
|
+
*
|
|
8039
|
+
* @example
|
|
8040
|
+
* ```typescript
|
|
8041
|
+
* // 내용만 교체 — document_id 는 그대로
|
|
8042
|
+
* const doc = await cb.knowledge.updateDocument('kb-id', 'doc-id', {
|
|
8043
|
+
* content: '갱신된 환불 정책...',
|
|
8044
|
+
* })
|
|
8045
|
+
*
|
|
8046
|
+
* // 이름 + 메타데이터 교체
|
|
8047
|
+
* await cb.knowledge.updateDocument('kb-id', 'doc-id', {
|
|
8048
|
+
* name: 'FAQ (2026)',
|
|
8049
|
+
* metadata: { tag: 'faq', updated: '2026-05' },
|
|
8050
|
+
* })
|
|
8051
|
+
* ```
|
|
8052
|
+
*/
|
|
8053
|
+
async updateDocument(kbID, docID, data) {
|
|
8054
|
+
return this.http.put(
|
|
8055
|
+
`/v1/public/knowledge-bases/${kbID}/documents/${docID}`,
|
|
8056
|
+
data
|
|
8057
|
+
);
|
|
8058
|
+
}
|
|
8059
|
+
/**
|
|
8060
|
+
* 파일로 문서 수정 (PDF / DOCX / text 파일 재업로드).
|
|
8061
|
+
*
|
|
8062
|
+
* [`addDocumentFromFile`](#addDocumentFromFile) 의 update 버전. 문서 id 는 유지됩니다.
|
|
8063
|
+
*
|
|
8064
|
+
* @param kbID - Knowledge Base ID
|
|
8065
|
+
* @param docID - 문서 ID
|
|
8066
|
+
* @param file - 새 파일. `File` (DOM) / `Blob` / `{ data, mimeType, name }` (Node) 모두 가능
|
|
8067
|
+
* @param options - name / metadata 오버라이드
|
|
8068
|
+
* @returns 수정된 문서 정보
|
|
8069
|
+
*/
|
|
8070
|
+
async updateDocumentFromFile(kbID, docID, file, options) {
|
|
8071
|
+
const { data, mimeType } = await readFileInput(file);
|
|
8072
|
+
return this.updateDocument(kbID, docID, {
|
|
8073
|
+
name: options?.name,
|
|
8074
|
+
file_content: data,
|
|
8075
|
+
mime_type: mimeType,
|
|
8076
|
+
metadata: options?.metadata
|
|
8077
|
+
});
|
|
8078
|
+
}
|
|
8018
8079
|
/**
|
|
8019
8080
|
* 파일을 KB 에 추가 (PDF / DOCX / text 파일).
|
|
8020
8081
|
*
|
|
@@ -8159,6 +8220,7 @@ var AIAPI = class {
|
|
|
8159
8220
|
* knowledgeBaseId: 'kb-id',
|
|
8160
8221
|
* }, {
|
|
8161
8222
|
* onSources: (sources) => console.log('참조:', sources),
|
|
8223
|
+
* onReasoning: (reasoning) => process.stdout.write(reasoning),
|
|
8162
8224
|
* onToken: (content) => process.stdout.write(content),
|
|
8163
8225
|
* onDone: () => console.log('\\n완료'),
|
|
8164
8226
|
* onError: (error) => console.error('에러:', error)
|
|
@@ -8220,6 +8282,7 @@ var AIAPI = class {
|
|
|
8220
8282
|
if (event.type === "heartbeat" || event.type === "searching") {
|
|
8221
8283
|
continue;
|
|
8222
8284
|
}
|
|
8285
|
+
if (event.reasoning) callbacks.onReasoning?.(event.reasoning);
|
|
8223
8286
|
if (event.content) callbacks.onToken?.(event.content);
|
|
8224
8287
|
if (event.done) {
|
|
8225
8288
|
callbacks.onDone?.();
|