connectbase-client 3.35.1 → 3.35.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/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  본 SDK 의 모든 주요 변경사항을 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/) 형식으로 기록합니다.
4
4
  버전은 [Semantic Versioning](https://semver.org/lang/ko/) 을 따릅니다.
5
5
 
6
+ ## [3.35.2] - 2026-06-22
7
+
8
+ ### Changed — 문서·타입 폴리시 (런타임 동작 변화 없음)
9
+
10
+ SDK 감사에서 발견된 문서·타입 정합성 개선. 공개 API 의 런타임 동작은 동일하다.
11
+
12
+ - **README AI Streaming 멀티프로바이더 정정** — "Gemini 전용" 프레이밍을 제거하고 실제 지원 프로바이더 6종(`gemini` / `openai` / `claude` / `ollama` / `lm_studio` / `openai_compatible`)을 반영. Stream Options 표의 `provider` 타입을 전체 union 으로 교체하고, `provider`/`model`/`temperature` 의 기본값은 SDK 가 강제하지 않고 서버측 앱 AI 설정에서 결정됨을 명시. 누락돼 있던 `mcpGroup` 옵션도 표에 추가.
13
+ - **`endpoint.pollUntil` predicate 타입 강화 (타입 전용)** — predicate 파라미터를 `(body: any, ...)` → **`(body: unknown, ...)`** 로 변경. 공개 표면에 남아 있던 유일한 `any` 를 제거하고 호출자에게 응답 narrowing 을 강제한다. 런타임 동작은 동일하며, JSDoc 예제도 `unknown` narrowing 방식으로 갱신.
14
+ - **JSDoc 정정** — `recent-calls.ts` 의 breadcrumb 저장 정책 주석이 "쿼리 키 선별 redact" 라 적혀 있었으나 실제 구현은 쿼리스트링을 통째로 strip(더 안전)하므로 주석을 구현에 맞게 정정. `http.ts` 의 stale 참조 `client.support.getRecentCalls()` → `client.support.getRecentApiCalls()` 정정.
15
+
6
16
  ## [3.35.1] - 2026-06-19
7
17
 
8
18
  ### Changed — 내부 하드닝 (공개 API 동작 변화 없음)
package/README.md CHANGED
@@ -113,7 +113,7 @@ try {
113
113
  - **Push Notifications**: Cross-platform push notification support
114
114
  - **WebRTC**: Real-time audio/video communication
115
115
  - **Payments**: Subscription and one-time payment support
116
- - **AI Streaming**: Real-time AI text generation via WebSocket (Gemini)
116
+ - **AI Streaming**: Real-time AI text generation via WebSocket (multi-provider: Gemini, OpenAI, Claude, Ollama, LM Studio, OpenAI-compatible)
117
117
  - **Knowledge Base (RAG)**: Document indexing + BM25 search with nori 한국어 형태소. PDF / DOCX / text file upload via `addDocumentFromFile`
118
118
  - **Endpoint**: Call your own GPU models on your own PC through one `cb_pk_*` key — ConnectBase forwards the payload as-is (dumb pipe)
119
119
  - **Support**: End-user feedback/issue reporting — users send issues to app operators, AI auto-classifies summary/urgency/category
@@ -959,7 +959,10 @@ const unsubTyping = await cb.realtime.onTypingChange('room-id', (typing) => {
959
959
 
960
960
  #### AI Streaming
961
961
 
962
- Real-time AI text generation using Gemini API through WebSocket.
962
+ Real-time AI text generation through WebSocket. The provider and model are
963
+ resolved from your app's AI config on the server; you can optionally override
964
+ them per request (`provider` / `model`). Supported providers: Gemini, OpenAI,
965
+ Claude, Ollama, LM Studio, and any OpenAI-compatible endpoint.
963
966
 
964
967
  ```typescript
965
968
  // Connect first
@@ -987,9 +990,11 @@ const session = await cb.realtime.stream(
987
990
  }
988
991
  },
989
992
  {
990
- model: 'gemini-2.0-flash', // Optional: default is gemini-2.0-flash
991
- temperature: 0.7, // Optional: 0.0-2.0, default 0.7
992
- maxTokens: 1000 // Optional: max output tokens
993
+ // All fields optional. When omitted, the server uses your app's AI config.
994
+ provider: 'openai', // Optional: override the app's configured provider
995
+ model: 'gpt-4o', // Optional: override the app's configured model
996
+ temperature: 0.7, // Optional: 0.0-2.0
997
+ maxTokens: 1000 // Optional: max output tokens
993
998
  }
994
999
  )
995
1000
 
@@ -997,16 +1002,17 @@ const session = await cb.realtime.stream(
997
1002
  await session.stop()
998
1003
  ```
999
1004
 
1000
- **Stream Options:**
1005
+ **Stream Options:** (all optional — defaults are resolved server-side from your app's AI config, not by the SDK)
1001
1006
  | Option | Type | Default | Description |
1002
1007
  |--------|------|---------|-------------|
1003
- | `provider` | `'gemini'` | `'gemini'` | AI provider |
1004
- | `model` | `string` | `'gemini-2.0-flash'` | Model name |
1008
+ | `provider` | `'gemini' \| 'openai' \| 'claude' \| 'ollama' \| 'lm_studio' \| 'openai_compatible'` | app config | Override the app's configured AI provider |
1009
+ | `model` | `string` | app config | Override the app's configured model |
1005
1010
  | `system` | `string` | - | System prompt |
1006
- | `temperature` | `number` | `0.7` | Creativity (0.0-2.0) |
1011
+ | `temperature` | `number` | app config | Creativity (0.0-2.0) |
1007
1012
  | `maxTokens` | `number` | - | Max output tokens |
1008
1013
  | `sessionId` | `string` | auto | Session tracking ID |
1009
1014
  | `metadata` | `object` | - | Custom metadata |
1015
+ | `mcpGroup` | `string` | - | MCP group slug — enables AI Agent mode (registered MCP server tools) |
1010
1016
 
1011
1017
  **Stream Result (onDone):**
1012
1018
  | Field | Type | Description |
package/dist/index.d.mts CHANGED
@@ -96,10 +96,10 @@ interface AbortOptions {
96
96
  * Recent API calls breadcrumb buffer — SDK 디버깅 / platform issue 발행 시 자동 첨부.
97
97
  *
98
98
  * **저장 정책 (PII 보호):**
99
- * - method, path (query string strip), status, duration_ms, timestamp 만 저장
99
+ * - method, path (query string 전체 strip), status, duration_ms, timestamp 만 저장
100
100
  * - body / response body / 인증 토큰 미저장
101
- * - URL secret-like 패턴 (key=, token=, password=) 자동 redact
102
- * - `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint path 만 (쿼리 strip)
101
+ * - 쿼리스트링은 단위 redact 가 아니라 통째로 제거 (토큰/PII 누출 가능성 0)
102
+ * - 따라서 `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint path 만 보존
103
103
  */
104
104
  interface RecentApiCall {
105
105
  method: string;
@@ -187,7 +187,7 @@ declare class HttpClient {
187
187
  private refreshLockedUntil;
188
188
  /**
189
189
  * 최근 API 호출 breadcrumb (PII strip 후 저장). platform_issue 발행 시 자동 첨부 가능.
190
- * `client.support.getRecentCalls()` 로 외부 노출.
190
+ * `client.support.getRecentApiCalls()` 로 외부 노출.
191
191
  */
192
192
  private recentCalls;
193
193
  /**
@@ -7981,6 +7981,9 @@ declare class EndpointAPI {
7981
7981
  * predicate 는 같은 Response 를 한 번만 읽을 수 있으므로, 헬퍼 내부에서
7982
7982
  * `res.clone().json()` 형태로 안전하게 파싱한 뒤 호출자에게 전달.
7983
7983
  *
7984
+ * predicate 의 `body` 는 `unknown` 으로 전달되므로, 호출자가 자신의 응답
7985
+ * 스키마로 narrowing 한 뒤 사용한다 (런타임 검증 책임은 호출자에게 있음).
7986
+ *
7984
7987
  * @example ComfyUI 결과 폴링
7985
7988
  * ```typescript
7986
7989
  * type Hist = Record<string, { outputs: Record<string, { images?: { filename: string }[] }> }>
@@ -7988,7 +7991,8 @@ declare class EndpointAPI {
7988
7991
  * const filename = await cb.endpoint.pollUntil<string>(
7989
7992
  * "comfyui-main",
7990
7993
  * { path: `/history/${promptId}` },
7991
- * (data: Hist) => {
7994
+ * (body) => {
7995
+ * const data = body as Hist
7992
7996
  * const entry = data[promptId]
7993
7997
  * if (!entry) return undefined // 아직 큐에 있음
7994
7998
  * for (const out of Object.values(entry.outputs)) {
@@ -8031,7 +8035,7 @@ declare class EndpointAPI {
8031
8035
  * ```
8032
8036
  */
8033
8037
  connectWebSocket(label: string, opts?: ConnectWebSocketOptions): Promise<WebSocket>;
8034
- pollUntil<T>(label: string, init: EndpointCallInit, predicate: (body: any, res: Response) => T | undefined | Promise<T | undefined>, opts?: PollUntilOptions): Promise<T>;
8038
+ pollUntil<T>(label: string, init: EndpointCallInit, predicate: (body: unknown, res: Response) => T | undefined | Promise<T | undefined>, opts?: PollUntilOptions): Promise<T>;
8035
8039
  }
8036
8040
  /**
8037
8041
  * EndpointAPI.call 의 init 인자.
package/dist/index.d.ts CHANGED
@@ -96,10 +96,10 @@ interface AbortOptions {
96
96
  * Recent API calls breadcrumb buffer — SDK 디버깅 / platform issue 발행 시 자동 첨부.
97
97
  *
98
98
  * **저장 정책 (PII 보호):**
99
- * - method, path (query string strip), status, duration_ms, timestamp 만 저장
99
+ * - method, path (query string 전체 strip), status, duration_ms, timestamp 만 저장
100
100
  * - body / response body / 인증 토큰 미저장
101
- * - URL secret-like 패턴 (key=, token=, password=) 자동 redact
102
- * - `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint path 만 (쿼리 strip)
101
+ * - 쿼리스트링은 단위 redact 가 아니라 통째로 제거 (토큰/PII 누출 가능성 0)
102
+ * - 따라서 `/v1/auth/*`, `/v1/oauth/token` 등 민감 endpoint path 만 보존
103
103
  */
104
104
  interface RecentApiCall {
105
105
  method: string;
@@ -187,7 +187,7 @@ declare class HttpClient {
187
187
  private refreshLockedUntil;
188
188
  /**
189
189
  * 최근 API 호출 breadcrumb (PII strip 후 저장). platform_issue 발행 시 자동 첨부 가능.
190
- * `client.support.getRecentCalls()` 로 외부 노출.
190
+ * `client.support.getRecentApiCalls()` 로 외부 노출.
191
191
  */
192
192
  private recentCalls;
193
193
  /**
@@ -7981,6 +7981,9 @@ declare class EndpointAPI {
7981
7981
  * predicate 는 같은 Response 를 한 번만 읽을 수 있으므로, 헬퍼 내부에서
7982
7982
  * `res.clone().json()` 형태로 안전하게 파싱한 뒤 호출자에게 전달.
7983
7983
  *
7984
+ * predicate 의 `body` 는 `unknown` 으로 전달되므로, 호출자가 자신의 응답
7985
+ * 스키마로 narrowing 한 뒤 사용한다 (런타임 검증 책임은 호출자에게 있음).
7986
+ *
7984
7987
  * @example ComfyUI 결과 폴링
7985
7988
  * ```typescript
7986
7989
  * type Hist = Record<string, { outputs: Record<string, { images?: { filename: string }[] }> }>
@@ -7988,7 +7991,8 @@ declare class EndpointAPI {
7988
7991
  * const filename = await cb.endpoint.pollUntil<string>(
7989
7992
  * "comfyui-main",
7990
7993
  * { path: `/history/${promptId}` },
7991
- * (data: Hist) => {
7994
+ * (body) => {
7995
+ * const data = body as Hist
7992
7996
  * const entry = data[promptId]
7993
7997
  * if (!entry) return undefined // 아직 큐에 있음
7994
7998
  * for (const out of Object.values(entry.outputs)) {
@@ -8031,7 +8035,7 @@ declare class EndpointAPI {
8031
8035
  * ```
8032
8036
  */
8033
8037
  connectWebSocket(label: string, opts?: ConnectWebSocketOptions): Promise<WebSocket>;
8034
- pollUntil<T>(label: string, init: EndpointCallInit, predicate: (body: any, res: Response) => T | undefined | Promise<T | undefined>, opts?: PollUntilOptions): Promise<T>;
8038
+ pollUntil<T>(label: string, init: EndpointCallInit, predicate: (body: unknown, res: Response) => T | undefined | Promise<T | undefined>, opts?: PollUntilOptions): Promise<T>;
8035
8039
  }
8036
8040
  /**
8037
8041
  * EndpointAPI.call 의 init 인자.
package/dist/index.js CHANGED
@@ -184,7 +184,7 @@ var HttpClient = class {
184
184
  this.refreshLockedUntil = 0;
185
185
  /**
186
186
  * 최근 API 호출 breadcrumb (PII strip 후 저장). platform_issue 발행 시 자동 첨부 가능.
187
- * `client.support.getRecentCalls()` 로 외부 노출.
187
+ * `client.support.getRecentApiCalls()` 로 외부 노출.
188
188
  */
189
189
  this.recentCalls = new RecentCallsBuffer();
190
190
  /**
@@ -9120,6 +9120,9 @@ var EndpointAPI = class {
9120
9120
  * predicate 는 같은 Response 를 한 번만 읽을 수 있으므로, 헬퍼 내부에서
9121
9121
  * `res.clone().json()` 형태로 안전하게 파싱한 뒤 호출자에게 전달.
9122
9122
  *
9123
+ * predicate 의 `body` 는 `unknown` 으로 전달되므로, 호출자가 자신의 응답
9124
+ * 스키마로 narrowing 한 뒤 사용한다 (런타임 검증 책임은 호출자에게 있음).
9125
+ *
9123
9126
  * @example ComfyUI 결과 폴링
9124
9127
  * ```typescript
9125
9128
  * type Hist = Record<string, { outputs: Record<string, { images?: { filename: string }[] }> }>
@@ -9127,7 +9130,8 @@ var EndpointAPI = class {
9127
9130
  * const filename = await cb.endpoint.pollUntil<string>(
9128
9131
  * "comfyui-main",
9129
9132
  * { path: `/history/${promptId}` },
9130
- * (data: Hist) => {
9133
+ * (body) => {
9134
+ * const data = body as Hist
9131
9135
  * const entry = data[promptId]
9132
9136
  * if (!entry) return undefined // 아직 큐에 있음
9133
9137
  * for (const out of Object.values(entry.outputs)) {
package/dist/index.mjs CHANGED
@@ -138,7 +138,7 @@ var HttpClient = class {
138
138
  this.refreshLockedUntil = 0;
139
139
  /**
140
140
  * 최근 API 호출 breadcrumb (PII strip 후 저장). platform_issue 발행 시 자동 첨부 가능.
141
- * `client.support.getRecentCalls()` 로 외부 노출.
141
+ * `client.support.getRecentApiCalls()` 로 외부 노출.
142
142
  */
143
143
  this.recentCalls = new RecentCallsBuffer();
144
144
  /**
@@ -9074,6 +9074,9 @@ var EndpointAPI = class {
9074
9074
  * predicate 는 같은 Response 를 한 번만 읽을 수 있으므로, 헬퍼 내부에서
9075
9075
  * `res.clone().json()` 형태로 안전하게 파싱한 뒤 호출자에게 전달.
9076
9076
  *
9077
+ * predicate 의 `body` 는 `unknown` 으로 전달되므로, 호출자가 자신의 응답
9078
+ * 스키마로 narrowing 한 뒤 사용한다 (런타임 검증 책임은 호출자에게 있음).
9079
+ *
9077
9080
  * @example ComfyUI 결과 폴링
9078
9081
  * ```typescript
9079
9082
  * type Hist = Record<string, { outputs: Record<string, { images?: { filename: string }[] }> }>
@@ -9081,7 +9084,8 @@ var EndpointAPI = class {
9081
9084
  * const filename = await cb.endpoint.pollUntil<string>(
9082
9085
  * "comfyui-main",
9083
9086
  * { path: `/history/${promptId}` },
9084
- * (data: Hist) => {
9087
+ * (body) => {
9088
+ * const data = body as Hist
9085
9089
  * const entry = data[promptId]
9086
9090
  * if (!entry) return undefined // 아직 큐에 있음
9087
9091
  * for (const out of Object.values(entry.outputs)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectbase-client",
3
- "version": "3.35.1",
3
+ "version": "3.35.2",
4
4
  "description": "Connect Base JavaScript/TypeScript SDK for browser and Node.js",
5
5
  "repository": {
6
6
  "type": "git",