connectbase-client 3.35.1 → 3.36.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 +29 -0
- package/README.md +15 -9
- package/dist/connect-base.umd.js +2 -2
- package/dist/index.d.mts +62 -25
- package/dist/index.d.ts +62 -25
- package/dist/index.js +75 -42
- package/dist/index.mjs +75 -42
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
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.36.0] - 2026-06-24
|
|
7
|
+
|
|
8
|
+
### Added — Functions 에서 시크릿 키 없이 푸시 발송 (service_role / act-as-member)
|
|
9
|
+
|
|
10
|
+
서버사이드 함수가 별도 시크릿 키(`cb_sk_`) 발급 없이 `ctx.cbAdmin`(service_role) 또는
|
|
11
|
+
`ctx.cb`(act-as-member)로 푸시를 보낼 수 있도록 `push.sendToMembers` 의 호출 가드를 완화했다.
|
|
12
|
+
백엔드 dual-auth(`POST /v1/apps/:appID/push/send`)가 service_role 토큰을 받도록 함께 확장됐다.
|
|
13
|
+
|
|
14
|
+
- **`push.sendToMembers` 위임 Bearer 허용** — 기존 가드 `if (hasPublicKey()) throw` 는
|
|
15
|
+
`cbWithToken`(ctx.cbAdmin/ctx.cb) 클라이언트가 앱 식별용 `cb_pk_` 를 함께 보내는 탓에
|
|
16
|
+
위임 호출까지 차단했다. 가드를 **`hasPublicKey() && !hasJWT()`** 로 변경해, 순수 브라우저
|
|
17
|
+
(Public Key 단독) 인스턴스만 차단하고 위임 Bearer 토큰을 가진 인스턴스는 통과시킨다.
|
|
18
|
+
공개 API 시그니처·타입 표면은 동일하다.
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
// service_role: true 함수에서 — 시크릿 키 불필요
|
|
22
|
+
await ctx.cbAdmin.push.sendToMembers(ctx.appId, [memberId], { title, body, data })
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## [3.35.2] - 2026-06-22
|
|
26
|
+
|
|
27
|
+
### Changed — 문서·타입 폴리시 (런타임 동작 변화 없음)
|
|
28
|
+
|
|
29
|
+
SDK 감사에서 발견된 문서·타입 정합성 개선. 공개 API 의 런타임 동작은 동일하다.
|
|
30
|
+
|
|
31
|
+
- **README AI Streaming 멀티프로바이더 정정** — "Gemini 전용" 프레이밍을 제거하고 실제 지원 프로바이더 6종(`gemini` / `openai` / `claude` / `ollama` / `lm_studio` / `openai_compatible`)을 반영. Stream Options 표의 `provider` 타입을 전체 union 으로 교체하고, `provider`/`model`/`temperature` 의 기본값은 SDK 가 강제하지 않고 서버측 앱 AI 설정에서 결정됨을 명시. 누락돼 있던 `mcpGroup` 옵션도 표에 추가.
|
|
32
|
+
- **`endpoint.pollUntil` predicate 타입 강화 (타입 전용)** — predicate 파라미터를 `(body: any, ...)` → **`(body: unknown, ...)`** 로 변경. 공개 표면에 남아 있던 유일한 `any` 를 제거하고 호출자에게 응답 narrowing 을 강제한다. 런타임 동작은 동일하며, JSDoc 예제도 `unknown` narrowing 방식으로 갱신.
|
|
33
|
+
- **JSDoc 정정** — `recent-calls.ts` 의 breadcrumb 저장 정책 주석이 "쿼리 키 선별 redact" 라 적혀 있었으나 실제 구현은 쿼리스트링을 통째로 strip(더 안전)하므로 주석을 구현에 맞게 정정. `http.ts` 의 stale 참조 `client.support.getRecentCalls()` → `client.support.getRecentApiCalls()` 정정.
|
|
34
|
+
|
|
6
35
|
## [3.35.1] - 2026-06-19
|
|
7
36
|
|
|
8
37
|
### 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
|
|
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
|
-
|
|
991
|
-
|
|
992
|
-
|
|
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'
|
|
1004
|
-
| `model` | `string` |
|
|
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` |
|
|
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 |
|