@reopt-ai/brandapp-sdk 4.3.0 → 4.5.0-platform.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +1 -1
  3. package/dist/ai/index.d.ts +1 -1
  4. package/dist/ai/index.js +1 -1
  5. package/dist/ai-provider/index.js +76 -65
  6. package/dist/analytics/index.d.ts +1 -1
  7. package/dist/analytics/index.js +1 -1
  8. package/dist/auth/index.d.ts +1 -1
  9. package/dist/auth/index.js +1 -1
  10. package/dist/better-auth/index.d.ts +1 -1
  11. package/dist/better-auth/index.js +2 -2
  12. package/dist/{client-D5F6-YYU.d.ts → client-7I-mz3Dw.d.ts} +2 -2
  13. package/dist/{client-BMgVQ4U-.js → client-B0XUjOuP.js} +12 -5
  14. package/dist/{client-D4kUDFwW.js → client-B270eCrs.js} +2 -2
  15. package/dist/{client-BD1-resY.js → client-BIMl52kc.js} +3 -3
  16. package/dist/{client-p4LmfF27.js → client-BNht520A.js} +2 -2
  17. package/dist/{client-bXAnGNzC.d.ts → client-BSW0Ncjj.d.ts} +2 -2
  18. package/dist/{client-CNPfjmT0.d.ts → client-Bfutv3LK.d.ts} +2 -2
  19. package/dist/{client-Hc7SfeIf.js → client-BwgCbfXv.js} +2 -2
  20. package/dist/{client-vjIDamSf.js → client-C2ALt685.js} +3 -3
  21. package/dist/{client-DjgoTlfv.d.ts → client-C6OXGMMV.d.ts} +2 -2
  22. package/dist/{client-BpEWDfSl.js → client-CKi1NpMR.js} +2 -2
  23. package/dist/{client-B4CiEei5.d.ts → client-COKDtHO9.d.ts} +2 -2
  24. package/dist/{client-BOEyVc8V.d.ts → client-CniCGdmi.d.ts} +2 -2
  25. package/dist/{client-BVvAfEXG.js → client-Cv1bdMBf.js} +2 -2
  26. package/dist/{client-DA9ibl3G.d.ts → client-D1AFtJRw.d.ts} +2 -2
  27. package/dist/{client-CaWHvclV.js → client-DNzgX_md.js} +70 -6
  28. package/dist/{client-DYammrtw.d.ts → client-Dmvtr1nS.d.ts} +2 -2
  29. package/dist/{client-CRim5LCH.d.ts → client-IUSZDJio.d.ts} +2 -2
  30. package/dist/{client-CIUecAJE.js → client-WxPjMNy_.js} +2 -2
  31. package/dist/{client-BBxhqs8l.d.ts → client-yKeRJnIB.d.ts} +2 -2
  32. package/dist/cms/index.d.ts +1 -1
  33. package/dist/cms/index.js +1 -1
  34. package/dist/{config-D28P8iwm.d.ts → config-D3SblxWt.d.ts} +19 -2
  35. package/dist/{config-D8dSL6OQ.js → config-DkT0F-GG.js} +2 -2
  36. package/dist/eav/index.d.ts +3 -3
  37. package/dist/eav/index.js +3 -33
  38. package/dist/eav/migrate.d.ts +2 -2
  39. package/dist/eav/schema.d.ts +2 -2
  40. package/dist/feedback/index.d.ts +1 -1
  41. package/dist/feedback/index.js +1 -1
  42. package/dist/files/index.d.ts +1 -1
  43. package/dist/files/index.js +1 -1
  44. package/dist/{http-client-0Sp8wQGQ.js → http-client-BO5A5n4I.js} +2 -2
  45. package/dist/{index-DwIr8W3Y.d.ts → index-BnAYxnwq.d.ts} +12 -12
  46. package/dist/index.d.ts +4 -4
  47. package/dist/index.js +12 -12
  48. package/dist/logout/index.d.ts +1 -1
  49. package/dist/logout/index.js +1 -1
  50. package/dist/plans/index.d.ts +1 -1
  51. package/dist/plans/index.js +1 -1
  52. package/dist/push/index.d.ts +1 -1
  53. package/dist/push/index.js +1 -1
  54. package/dist/{query-C18XolkY.js → query-D08B_HFt.js} +2 -2
  55. package/dist/react/hooks.d.ts +4 -4
  56. package/dist/terms/index.d.ts +1 -1
  57. package/dist/terms/index.js +1 -1
  58. package/dist/testing/index.d.ts +1 -1
  59. package/dist/webhooks/index.d.ts +25 -2
  60. package/dist/workspace/index.d.ts +253 -0
  61. package/dist/workspace/index.js +335 -0
  62. package/docs/api-reference.md +16 -11
  63. package/docs/cms.md +3 -1
  64. package/package.json +10 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,37 @@ This project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.5.0-platform.0] - 2026-09-07
11
+
12
+ ### Added
13
+
14
+ - `@reopt-ai/brandapp-sdk/workspace` — 플랫폼 API(RFC-0029, `platform.reopt.ai`) 클라이언트. **서버 전용.**
15
+ `createPlatformClient({ clientId, clientSecret })`가 `client_credentials`로 platform audience 토큰을 받아
16
+ `works.{listPipelines,upsertTask,getTask,setTaskStage}`·`webhooks.{list,upsert,delete}`·`me()`를 부른다
17
+ (토큰 캐시·만료 60초 전 재발급·401 시 1회 재발급·`fetch` 주입). 요청·응답·웹훅 payload zod 스키마와
18
+ 타입을 함께 export한다. `zod`는 이 서브패스만 쓰는 optional peer.
19
+ - `webhooks`: `workTaskStageChanged` 이벤트 타입 + `WorkTaskStageChangedWebhookData`.
20
+
21
+ ## [4.4.0] — 2026-09-07
22
+
23
+ ### Added
24
+
25
+ - `RECORDS_PAGE_LIMIT_MAX`(=100)를 `@reopt-ai/brandapp-sdk/eav`에서 export한다 — 페이지 루프 상수를 소비자가 손으로 적지 않아도 된다.
26
+
27
+ ### Changed
28
+
29
+ - `eav.records.list()`가 서버 상한을 넘긴 `limit`을 요청 전에 `BadRequestError`로
30
+ 거절한다(상한 100, `RECORDS_PAGE_LIMIT_MAX`로 export). 조용히 100으로 낮추지
31
+ 않는다 — 200을 요청한 호출부가 100건을 "전부"로 읽으면 400보다 나쁘다. 여러
32
+ 페이지가 필요하면 `records.listAll()`을 쓴다. `listAll()`·`backfill()`의 페이지
33
+ 크기는 결과 총량에 영향이 없으므로 상한으로 낮춘다.
34
+ 프로덕션 2026-08-30~09-05: `limit: 200`이 닷새간 400을 받는 동안 크레딧
35
+ dead-letter 스윕이 한 건도 정산되지 않았고, SDK는 상한을 말한 적이 없었다.
36
+ - 문서: sitemap·RSS 예시가 `cms.posts.list({ limit: 200 })`을 가르치고 있었다 —
37
+ cms 목록 상한도 100이라 그대로 따라 쓰면 400이다.
38
+
39
+ ## [4.3.0] — 2026-09-05
40
+
10
41
  ### Added
11
42
 
12
43
  - `FeedbackStatus`에 `resolved`(해결됨)가 추가됐다 — `responded`는 "답변함", `resolved`는 "고쳐졌다/결론이 났다"를 뜻한다. `feedback.list({ status })` 필터와 응답의 `status`에 그대로 나타난다.
package/README.md CHANGED
@@ -112,7 +112,7 @@ import { toRssFeed, toSitemapItems } from "@reopt-ai/brandapp-sdk/cms";
112
112
  export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
113
113
  const { records } = await sdk.cms.posts.list({
114
114
  status: "published",
115
- limit: 200,
115
+ limit: 100, // 상한 100 — 넘기면 400이다
116
116
  });
117
117
  return toSitemapItems(records, { siteUrl: "https://www.example.com" });
118
118
  }
@@ -1,2 +1,2 @@
1
- import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, n as createReoptAiClient, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, t as ReoptAiClient, u as ImageGenerateResult } from "../client-DA9ibl3G.js";
1
+ import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, n as createReoptAiClient, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, t as ReoptAiClient, u as ImageGenerateResult } from "../client-D1AFtJRw.js";
2
2
  export { type AgentInfo, type ChatMessage, type CompletionOptions, type CompletionResult, type CreditInfo, type FinishReason, type ImageGenerateOptions, type ImageGenerateResult, type MessageRole, type ModelInfo, ReoptAiClient, type StreamDoneData, type StreamEvent, createReoptAiClient };
package/dist/ai/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as createReoptAiClient, t as ReoptAiClient } from "../client-BMgVQ4U-.js";
1
+ import { n as createReoptAiClient, t as ReoptAiClient } from "../client-B0XUjOuP.js";
2
2
 
3
3
  export { ReoptAiClient, createReoptAiClient };
@@ -1,8 +1,8 @@
1
- import { i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-D8dSL6OQ.js";
1
+ import { i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, r as assertBrowserSafe } from "../config-DkT0F-GG.js";
2
2
  import { t as createManagedAbort } from "../abort--nOBFN4M.js";
3
3
  import { t as createAuthHeader } from "../encoding-Bwfm3iaE.js";
4
4
  import { t as createSSELineProcessor } from "../sse-parser-FMjxM7sY.js";
5
- import { APICallError, NoSuchModelError } from "@ai-sdk/provider";
5
+ import { APICallError, NoSuchModelError, UnsupportedFunctionalityError } from "@ai-sdk/provider";
6
6
 
7
7
  //#region src/ai-provider/provider-http.ts
8
8
  /**
@@ -201,15 +201,9 @@ var BrandappImageModel = class {
201
201
  feature: "seed",
202
202
  details: "BrandApp AI API does not support seed parameter"
203
203
  });
204
- if (options.files?.length) warnings.push({
205
- type: "unsupported",
206
- feature: "files",
207
- details: "BrandApp AI API does not support image editing or variation generation"
208
- });
209
- if (options.mask != null) warnings.push({
210
- type: "unsupported",
211
- feature: "mask",
212
- details: "BrandApp AI API does not support inpainting masks"
204
+ if (options.files?.length || options.mask != null) throw new UnsupportedFunctionalityError({
205
+ functionality: "image editing / reference images / masks",
206
+ message: "BrandApp AI API does not accept reference images or masks. No image was generated."
213
207
  });
214
208
  return warnings;
215
209
  }
@@ -225,8 +219,8 @@ function arrayBufferToBase64(bytes) {
225
219
  * AI SDK 프롬프트 → BrandApp API 메시지 배열 (+ 손실 변환 보고).
226
220
  *
227
221
  * BrandApp API는 텍스트 전용이라 비-text part는 손실된다. 무엇이 손실됐는지를
228
- * `droppedParts`로 돌려줘 호출자(language model)가 `warnings`로 **소리내어** 알리게
229
- * 한다(과거엔 file/image 입력이 조용히 사라졌다).
222
+ * `droppedParts`로 돌려준다. 호출자는 파일 입력이면 요청을 거절하고,
223
+ * 도구 이력의 텍스트 변환이면 warning으로 알린다.
230
224
  *
231
225
  * - system: content 문자열 그대로
232
226
  * - user: text part만 추출하여 결합 / file part는 드롭("file" 보고)
@@ -236,47 +230,50 @@ function arrayBufferToBase64(bytes) {
236
230
  function convertPromptToBrandappMessages(prompt) {
237
231
  const messages = [];
238
232
  const dropped = /* @__PURE__ */ new Set();
239
- for (const message of prompt) switch (message.role) {
240
- case "system":
241
- messages.push({
242
- role: "system",
243
- content: message.content
244
- });
245
- break;
246
- case "user": {
247
- const textParts = [];
248
- for (const part of message.content) if (part.type === "text") textParts.push(part.text);
249
- else dropped.add("file");
250
- if (textParts.length > 0) messages.push({
251
- role: "user",
252
- content: textParts.join("\n")
253
- });
254
- break;
255
- }
256
- case "assistant": {
257
- const textParts = message.content.filter((part) => part.type === "text").map((part) => part.text);
258
- const toolCallParts = message.content.filter((part) => part.type === "tool-call").map((part) => `[Tool Call: ${part.toolName}(${typeof part.input === "string" ? part.input : JSON.stringify(part.input)})]`);
259
- if (toolCallParts.length > 0) dropped.add("tool-call");
260
- const allText = [...textParts, ...toolCallParts].join("\n");
261
- if (allText.length > 0) messages.push({
262
- role: "assistant",
263
- content: allText
264
- });
265
- break;
266
- }
267
- case "tool": {
268
- const resultParts = message.content.filter((part) => part.type === "tool-result").map((part) => {
269
- const output = typeof part.output === "string" ? part.output : JSON.stringify(part.output);
270
- return `[Tool Result: ${part.toolName}] ${output}`;
271
- });
272
- if (resultParts.length > 0) {
273
- dropped.add("tool-result");
233
+ for (const message of prompt) {
234
+ if (message.role !== "system" && message.content.some((part) => part.type === "file" || part.type === "tool-result" && part.output.type === "content" && part.output.value.some((item) => item.type !== "text"))) dropped.add("file");
235
+ switch (message.role) {
236
+ case "system":
274
237
  messages.push({
238
+ role: "system",
239
+ content: message.content
240
+ });
241
+ break;
242
+ case "user": {
243
+ const textParts = [];
244
+ for (const part of message.content) if (part.type === "text") textParts.push(part.text);
245
+ else dropped.add("file");
246
+ if (textParts.length > 0) messages.push({
275
247
  role: "user",
276
- content: resultParts.join("\n")
248
+ content: textParts.join("\n")
249
+ });
250
+ break;
251
+ }
252
+ case "assistant": {
253
+ const textParts = message.content.filter((part) => part.type === "text").map((part) => part.text);
254
+ const toolCallParts = message.content.filter((part) => part.type === "tool-call").map((part) => `[Tool Call: ${part.toolName}(${typeof part.input === "string" ? part.input : JSON.stringify(part.input)})]`);
255
+ if (toolCallParts.length > 0) dropped.add("tool-call");
256
+ const allText = [...textParts, ...toolCallParts].join("\n");
257
+ if (allText.length > 0) messages.push({
258
+ role: "assistant",
259
+ content: allText
260
+ });
261
+ break;
262
+ }
263
+ case "tool": {
264
+ const resultParts = message.content.filter((part) => part.type === "tool-result").map((part) => {
265
+ const output = typeof part.output === "string" ? part.output : JSON.stringify(part.output);
266
+ return `[Tool Result: ${part.toolName}] ${output}`;
277
267
  });
268
+ if (resultParts.length > 0) {
269
+ dropped.add("tool-result");
270
+ messages.push({
271
+ role: "user",
272
+ content: resultParts.join("\n")
273
+ });
274
+ }
275
+ break;
278
276
  }
279
- break;
280
277
  }
281
278
  }
282
279
  return {
@@ -417,10 +414,14 @@ var BrandappLanguageModel = class {
417
414
  }
418
415
  collectWarnings(options, droppedParts = []) {
419
416
  const warnings = [];
417
+ if (droppedParts.includes("file")) throw new UnsupportedFunctionalityError({
418
+ functionality: "image/file input",
419
+ message: "BrandApp AI API accepts text only. File input cannot be omitted."
420
+ });
420
421
  for (const part of droppedParts) warnings.push({
421
422
  type: "unsupported",
422
- feature: part === "file" ? "image/file input" : part,
423
- details: part === "file" ? "BrandApp AI API는 텍스트 전용입니다 — 이미지/파일 입력은 무시됩니다." : `BrandApp AI API does not support ${part} parts natively; converted to text (lossy).`
423
+ feature: part,
424
+ details: `BrandApp AI API does not support ${part} parts natively; converted to text (lossy).`
424
425
  });
425
426
  if (options.topP != null) warnings.push({
426
427
  type: "unsupported",
@@ -447,15 +448,9 @@ var BrandappLanguageModel = class {
447
448
  feature: "stopSequences",
448
449
  details: "BrandApp AI API does not support stopSequences parameter"
449
450
  });
450
- if (options.responseFormat?.type === "json") warnings.push({
451
- type: "unsupported",
452
- feature: "responseFormat",
453
- details: "BrandApp AI API does not support JSON response format directly. Use prompt engineering instead."
454
- });
455
- if (options.tools?.length) warnings.push({
456
- type: "unsupported",
457
- feature: "tools",
458
- details: "BrandApp AI API does not support tool calling. Tools will be ignored."
451
+ if (options.responseFormat?.type === "json" || options.tools?.length || options.toolChoice && options.toolChoice.type !== "none" && options.toolChoice.type !== "auto") throw new UnsupportedFunctionalityError({
452
+ functionality: options.responseFormat?.type === "json" ? "structured output" : "tool calling",
453
+ message: "BrandApp AI API supports text generation only. This request cannot be executed as plain text."
459
454
  });
460
455
  if (options.seed != null) warnings.push({
461
456
  type: "unsupported",
@@ -471,6 +466,7 @@ var BrandappLanguageModel = class {
471
466
  let emittedTextStart = false;
472
467
  let emittedTextEnd = false;
473
468
  let emittedFinish = false;
469
+ let emittedError = false;
474
470
  const textId = "text-0";
475
471
  function processSSEEvent({ event, data }, controller) {
476
472
  if (includeRawChunks) controller.enqueue({
@@ -505,6 +501,12 @@ var BrandappLanguageModel = class {
505
501
  }
506
502
  try {
507
503
  const meta = JSON.parse(data);
504
+ if (![
505
+ meta.usage?.promptTokens,
506
+ meta.usage?.completionTokens,
507
+ meta.usage?.creditCost,
508
+ meta.creditsRemaining
509
+ ].every(Number.isFinite)) throw new Error("Invalid BrandApp completion metadata");
508
510
  controller.enqueue({
509
511
  type: "finish",
510
512
  usage: {
@@ -520,7 +522,10 @@ var BrandappLanguageModel = class {
520
522
  reasoning: void 0
521
523
  }
522
524
  },
523
- finishReason: meta.finishReason ? {
525
+ finishReason: emittedError ? {
526
+ unified: "error",
527
+ raw: "stream_error"
528
+ } : meta.finishReason ? {
524
529
  unified: meta.finishReason.unified,
525
530
  raw: meta.finishReason.raw
526
531
  } : {
@@ -532,7 +537,12 @@ var BrandappLanguageModel = class {
532
537
  creditsRemaining: meta.creditsRemaining
533
538
  } }
534
539
  });
535
- } catch {
540
+ } catch (error) {
541
+ emittedError = true;
542
+ controller.enqueue({
543
+ type: "error",
544
+ error
545
+ });
536
546
  controller.enqueue({
537
547
  type: "finish",
538
548
  usage: {
@@ -549,14 +559,15 @@ var BrandappLanguageModel = class {
549
559
  }
550
560
  },
551
561
  finishReason: {
552
- unified: "stop",
553
- raw: "stop"
562
+ unified: "error",
563
+ raw: "invalid_completion_metadata"
554
564
  }
555
565
  });
556
566
  }
557
567
  emittedFinish = true;
558
568
  break;
559
569
  case "error":
570
+ emittedError = true;
560
571
  try {
561
572
  const err = JSON.parse(data);
562
573
  const mapped = typeof err.status === "number" ? mapHttpStatusToError(err.status, err.code, err.message) : new Error(err.message ?? "Stream error");
@@ -1,4 +1,4 @@
1
- import { n as createReoptAnalyticsClient, r as AnalyticsConfig, t as ReoptAnalyticsClient } from "../client-D5F6-YYU.js";
1
+ import { n as createReoptAnalyticsClient, r as AnalyticsConfig, t as ReoptAnalyticsClient } from "../client-7I-mz3Dw.js";
2
2
  import { identify, pageView, setConsent, track } from "@reopt-ai/data-sdk";
3
3
  //#region src/analytics/browser.d.ts
4
4
  type BrandappAnalytics = {
@@ -1,4 +1,4 @@
1
- import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-Hc7SfeIf.js";
1
+ import { n as createReoptAnalyticsClient, t as ReoptAnalyticsClient } from "../client-BwgCbfXv.js";
2
2
  import { getInstance, identify, init, pageView, setConsent, track } from "@reopt-ai/data-sdk";
3
3
 
4
4
  //#region src/analytics/browser.ts
@@ -1,4 +1,4 @@
1
- import { i as UserInfoClaims, n as createReoptAuthClient, r as LinkCurrentUserResult, t as ReoptAuthClient } from "../client-CNPfjmT0.js";
1
+ import { i as UserInfoClaims, n as createReoptAuthClient, r as LinkCurrentUserResult, t as ReoptAuthClient } from "../client-Bfutv3LK.js";
2
2
  //#region src/auth/session.d.ts
3
3
  /**
4
4
  * 세션 쿠키 검증 — apps/id의 Better Auth `/api/auth/get-session`을 호출해
@@ -1,4 +1,4 @@
1
- import { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-CIUecAJE.js";
1
+ import { n as createReoptAuthClient, t as ReoptAuthClient } from "../client-WxPjMNy_.js";
2
2
 
3
3
  //#region src/auth/session.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig, t as REOPT_BASE_URLS } from "../config-D28P8iwm.js";
1
+ import { n as ReoptSDKConfig, t as REOPT_BASE_URLS } from "../config-D3SblxWt.js";
2
2
  import { i as REOPT_PROVIDER_ID, n as AdapterRequestBody, r as REOPT_DEFAULT_SCOPES, t as AdapterOperation } from "../types-MXLudLBP.js";
3
3
  import { T as isReoptSDKError, _ as RateLimitError, t as AuthError, v as ReoptSDKError, x as ServerError } from "../errors-U3TsyWVq.js";
4
4
  import { AdapterFactory } from "better-auth/adapters";
@@ -1,5 +1,5 @@
1
- import { O as isReoptSDKError, S as ReoptSDKError, a as resolveIdBaseUrl, s as AuthError, t as REOPT_BASE_URLS, w as ServerError, x as RateLimitError } from "../config-D8dSL6OQ.js";
2
- import { t as BaseHttpClient } from "../http-client-0Sp8wQGQ.js";
1
+ import { O as isReoptSDKError, S as ReoptSDKError, a as resolveIdBaseUrl, s as AuthError, t as REOPT_BASE_URLS, w as ServerError, x as RateLimitError } from "../config-DkT0F-GG.js";
2
+ import { t as BaseHttpClient } from "../http-client-BO5A5n4I.js";
3
3
  import { n as REOPT_PROVIDER_ID, t as REOPT_DEFAULT_SCOPES } from "../types-DjDRszNj.js";
4
4
  import { createAdapterFactory } from "better-auth/adapters";
5
5
  import { genericOAuth } from "better-auth/plugins";
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
1
+ import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
2
2
  //#region src/analytics/types.d.ts
3
3
  /** `GET /brandapp/{id}/analytics/config` — 브랜드의 reopt-data 브라우저 수집 설정. */
4
4
  type AnalyticsConfig = {
@@ -21,4 +21,4 @@ declare class ReoptAnalyticsClient {
21
21
  declare function createReoptAnalyticsClient(config: ReoptSDKConfig): ReoptAnalyticsClient;
22
22
  //#endregion
23
23
  export { createReoptAnalyticsClient as n, AnalyticsConfig as r, ReoptAnalyticsClient as t };
24
- //# sourceMappingURL=client-D5F6-YYU.d.ts.map
24
+ //# sourceMappingURL=client-7I-mz3Dw.d.ts.map
@@ -1,6 +1,6 @@
1
- import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-D8dSL6OQ.js";
1
+ import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-DkT0F-GG.js";
2
2
  import { t as createManagedAbort } from "./abort--nOBFN4M.js";
3
- import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
3
+ import { t as BaseHttpClient } from "./http-client-BO5A5n4I.js";
4
4
  import { n as parseSSEStream } from "./sse-parser-FMjxM7sY.js";
5
5
 
6
6
  //#region src/ai/client.ts
@@ -118,7 +118,14 @@ var ReoptAiClient = class {
118
118
  };
119
119
  const self = this;
120
120
  async function* gen() {
121
- const { response, managed, requestId } = await self.fetchSSE(options);
121
+ let connection;
122
+ try {
123
+ connection = await self.fetchSSE(options);
124
+ } catch (error) {
125
+ settle(null);
126
+ throw error;
127
+ }
128
+ const { response, managed, requestId } = connection;
122
129
  if (!response.body) {
123
130
  managed.cleanup();
124
131
  settle(null);
@@ -224,7 +231,7 @@ var ReoptAiClient = class {
224
231
  }
225
232
  async fetchSSE(options) {
226
233
  const url = `${this.http.requestBaseUrl}/chat/completions`;
227
- const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.2.0"}-${url.length}`;
234
+ const requestId = globalThis.crypto?.randomUUID?.() ?? `sdk-${"4.5.0-platform.0"}-${url.length}`;
228
235
  const ctx = {
229
236
  method: "POST",
230
237
  url,
@@ -302,4 +309,4 @@ function createReoptAiClient(config) {
302
309
 
303
310
  //#endregion
304
311
  export { createReoptAiClient as n, ReoptAiClient as t };
305
- //# sourceMappingURL=client-BMgVQ4U-.js.map
312
+ //# sourceMappingURL=client-B0XUjOuP.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-BO5A5n4I.js";
2
2
 
3
3
  //#region src/push/client.ts
4
4
  var ReoptPushClient = class {
@@ -25,4 +25,4 @@ function createReoptPushClient(config) {
25
25
 
26
26
  //#endregion
27
27
  export { createReoptPushClient as n, ReoptPushClient as t };
28
- //# sourceMappingURL=client-D4kUDFwW.js.map
28
+ //# sourceMappingURL=client-B270eCrs.js.map
@@ -1,5 +1,5 @@
1
- import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
2
- import { t as buildQuery } from "./query-C18XolkY.js";
1
+ import { t as BaseHttpClient } from "./http-client-BO5A5n4I.js";
2
+ import { t as buildQuery } from "./query-D08B_HFt.js";
3
3
 
4
4
  //#region src/cms/client.ts
5
5
  function createReoptCmsClient(config) {
@@ -52,4 +52,4 @@ async list(query) {
52
52
 
53
53
  //#endregion
54
54
  export { createReoptCmsClient as t };
55
- //# sourceMappingURL=client-BD1-resY.js.map
55
+ //# sourceMappingURL=client-BIMl52kc.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-BO5A5n4I.js";
2
2
 
3
3
  //#region src/feedback/client.ts
4
4
  function buildListQuery(query) {
@@ -83,4 +83,4 @@ function createReoptFeedbackClient(config) {
83
83
 
84
84
  //#endregion
85
85
  export { createReoptFeedbackClient as n, ReoptFeedbackClient as t };
86
- //# sourceMappingURL=client-p4LmfF27.js.map
86
+ //# sourceMappingURL=client-BNht520A.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
1
+ import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
2
2
  //#region src/push/types.d.ts
3
3
  /** Push provider — native token kind. */
4
4
  type PushProvider = "fcm" | "apns";
@@ -50,4 +50,4 @@ declare class ReoptPushClient {
50
50
  declare function createReoptPushClient(config: ReoptSDKConfig): ReoptPushClient;
51
51
  //#endregion
52
52
  export { RegisterPushTokenInput as a, UnregisterPushTokenInput as c, PushProvider as i, UnregisterPushTokenResult as l, createReoptPushClient as n, RegisterPushTokenResult as o, PushPlatform as r, RegisteredPushDevice as s, ReoptPushClient as t };
53
- //# sourceMappingURL=client-bXAnGNzC.d.ts.map
53
+ //# sourceMappingURL=client-BSW0Ncjj.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
1
+ import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
2
2
  //#region src/auth/types.d.ts
3
3
  /**
4
4
  * User-scoped auth types.
@@ -68,4 +68,4 @@ declare class ReoptAuthClient {
68
68
  declare function createReoptAuthClient(config: ReoptSDKConfig): ReoptAuthClient;
69
69
  //#endregion
70
70
  export { UserInfoClaims as i, createReoptAuthClient as n, LinkCurrentUserResult as r, ReoptAuthClient as t };
71
- //# sourceMappingURL=client-CNPfjmT0.d.ts.map
71
+ //# sourceMappingURL=client-Bfutv3LK.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-BO5A5n4I.js";
2
2
 
3
3
  //#region src/analytics/client.ts
4
4
  var ReoptAnalyticsClient = class {
@@ -17,4 +17,4 @@ function createReoptAnalyticsClient(config) {
17
17
 
18
18
  //#endregion
19
19
  export { createReoptAnalyticsClient as n, ReoptAnalyticsClient as t };
20
- //# sourceMappingURL=client-Hc7SfeIf.js.map
20
+ //# sourceMappingURL=client-BwgCbfXv.js.map
@@ -1,6 +1,6 @@
1
- import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-D8dSL6OQ.js";
1
+ import { S as ReoptSDKError, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig } from "./config-DkT0F-GG.js";
2
2
  import { t as createManagedAbort } from "./abort--nOBFN4M.js";
3
- import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
3
+ import { n as parseFieldErrors, t as BaseHttpClient } from "./http-client-BO5A5n4I.js";
4
4
 
5
5
  //#region src/files/client.ts
6
6
  var ReoptFileClient = class {
@@ -270,4 +270,4 @@ function createReoptFileClient(config) {
270
270
 
271
271
  //#endregion
272
272
  export { createReoptFileClient as n, ReoptFileClient as t };
273
- //# sourceMappingURL=client-vjIDamSf.js.map
273
+ //# sourceMappingURL=client-C2ALt685.js.map
@@ -1,4 +1,4 @@
1
- import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpsertRecordInput, I as UpsertRecordResult, M as UpdateAttributeInput, N as UpdateEntityInput, P as UpdateRecordInput, S as DeleteWhereInput, _ as BulkUpdateItem, b as CreateEntityInput, c as InferValues, f as AttributeFilter, g as BackfillResult, h as BackfillOptions, j as PaginatedResponse, l as SchemaDef, n as ReoptSDKConfig, s as EntityDef, v as CountRecordsQuery, x as CreateRecordInput, y as CreateAttributeInput } from "./config-D28P8iwm.js";
1
+ import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpdateRecordInput, I as UpsertRecordInput, L as UpsertRecordResult, N as UpdateAttributeInput, P as UpdateEntityInput, S as DeleteWhereInput, _ as BulkUpdateItem, b as CreateEntityInput, c as InferValues, f as AttributeFilter, g as BackfillResult, h as BackfillOptions, j as PaginatedResponse, l as SchemaDef, n as ReoptSDKConfig, s as EntityDef, v as CountRecordsQuery, x as CreateRecordInput, y as CreateAttributeInput } from "./config-D3SblxWt.js";
2
2
  //#region src/eav/typed-client.d.ts
3
3
  /** EavRecord with typed values instead of Record<string, unknown> */
4
4
  type TypedEavRecord<V> = Omit<EavRecord, "values"> & {
@@ -100,4 +100,4 @@ type ReoptEavClient<S extends SchemaDef = SchemaDef> = {
100
100
  declare function createReoptEavClient<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptEavClient<S>;
101
101
  //#endregion
102
102
  export { TypedEavRecord as i, createReoptEavClient as n, EntityClient as r, ReoptEavClient as t };
103
- //# sourceMappingURL=client-DjgoTlfv.d.ts.map
103
+ //# sourceMappingURL=client-C6OXGMMV.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-BO5A5n4I.js";
2
2
 
3
3
  //#region src/terms/client.ts
4
4
  function unwrap(body) {
@@ -80,4 +80,4 @@ function createReoptTermsClient(config) {
80
80
 
81
81
  //#endregion
82
82
  export { createReoptTermsClient as n, ReoptTermsClient as t };
83
- //# sourceMappingURL=client-BpEWDfSl.js.map
83
+ //# sourceMappingURL=client-CKi1NpMR.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
1
+ import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
2
2
  //#region src/feedback/types.d.ts
3
3
  /**
4
4
  * Feedback processing status. `responded` means staff have answered but the
@@ -146,4 +146,4 @@ declare class ReoptFeedbackClient {
146
146
  declare function createReoptFeedbackClient(config: ReoptSDKConfig): ReoptFeedbackClient;
147
147
  //#endregion
148
148
  export { CreateFeedbackResult as a, FeedbackListMeta as c, FeedbackReplyAuthor as d, FeedbackStatus as f, CreateFeedbackReplyResult as i, FeedbackListResult as l, RateFeedbackReplyResult as m, createReoptFeedbackClient as n, Feedback as o, ListFeedbackQuery as p, CreateFeedbackInput as r, FeedbackDetail as s, ReoptFeedbackClient as t, FeedbackReply as u };
149
- //# sourceMappingURL=client-B4CiEei5.d.ts.map
149
+ //# sourceMappingURL=client-COKDtHO9.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
1
+ import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
2
2
  //#region src/files/types.d.ts
3
3
  /** 파일 정보 */
4
4
  type FileInfo = {
@@ -269,4 +269,4 @@ declare class ReoptFileClient {
269
269
  declare function createReoptFileClient(config: ReoptSDKConfig): ReoptFileClient;
270
270
  //#endregion
271
271
  export { FileListQuery as a, FolderInfo as c, UpdateFolderInput as d, UploadOptions as f, FileInfo as i, FolderListQuery as l, createReoptFileClient as n, FileListResponse as o, CreateFolderInput as r, FileUsageInfo as s, ReoptFileClient as t, UpdateFileInput as u };
272
- //# sourceMappingURL=client-BOEyVc8V.d.ts.map
272
+ //# sourceMappingURL=client-CniCGdmi.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-0Sp8wQGQ.js";
1
+ import { t as BaseHttpClient } from "./http-client-BO5A5n4I.js";
2
2
 
3
3
  //#region src/plans/client.ts
4
4
  function unwrap(body) {
@@ -78,4 +78,4 @@ function createReoptPlansClient(config) {
78
78
 
79
79
  //#endregion
80
80
  export { createReoptPlansClient as n, ReoptPlansClient as t };
81
- //# sourceMappingURL=client-BVvAfEXG.js.map
81
+ //# sourceMappingURL=client-Cv1bdMBf.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D28P8iwm.js";
1
+ import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
2
2
  //#region src/ai/types.d.ts
3
3
  /** 메시지 역할 */
4
4
  type MessageRole = "system" | "user" | "assistant";
@@ -281,4 +281,4 @@ declare class ReoptAiClient {
281
281
  declare function createReoptAiClient(config: ReoptSDKConfig): ReoptAiClient;
282
282
  //#endregion
283
283
  export { CompletionOptions as a, FinishReason as c, MessageRole as d, ModelInfo as f, ChatMessage as i, ImageGenerateOptions as l, StreamEvent as m, createReoptAiClient as n, CompletionResult as o, StreamDoneData as p, AgentInfo as r, CreditInfo as s, ReoptAiClient as t, ImageGenerateResult as u };
284
- //# sourceMappingURL=client-DA9ibl3G.d.ts.map
284
+ //# sourceMappingURL=client-D1AFtJRw.d.ts.map