@lastbrain/ai-ui-core 1.0.22 → 1.0.23

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.
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../src/client/createClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,QAAQ,EACT,MAAM,UAAU,CAAC;AA+FlB,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY;qBAsBnB,OAAO,CAAC,QAAQ,EAAE,CAAC;wBAqCd,aAAa,KAAG,OAAO,CAAC,cAAc,CAAC;yBAoCtC,cAAc,KAAG,OAAO,CAAC,eAAe,CAAC;iBAqDjD,cAAc,KAAG,OAAO,CAAC,eAAe,CAAC;qBAkBvC,OAAO,CAAC,QAAQ,CAAC;EAyB9C"}
1
+ {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../src/client/createClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,QAAQ,EACT,MAAM,UAAU,CAAC;AAkGlB,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY;qBAsBnB,OAAO,CAAC,QAAQ,EAAE,CAAC;wBAqCd,aAAa,KAAG,OAAO,CAAC,cAAc,CAAC;yBAoCtC,cAAc,KAAG,OAAO,CAAC,eAAe,CAAC;iBAqDjD,cAAc,KAAG,OAAO,CAAC,eAAe,CAAC;qBAkBvC,OAAO,CAAC,QAAQ,CAAC;EAyB9C"}
@@ -45,6 +45,7 @@ async function fetchWithRetry(url, options, retryConfig) {
45
45
  function buildUrl(baseUrl, endpoint) {
46
46
  const isInternalApp = baseUrl.includes("/api/ai");
47
47
  const isPublicApi = baseUrl.includes("/api/public/v1");
48
+ const isExternalProxy = baseUrl.includes("/api/lastbrain");
48
49
  // Map endpoints for internal vs external context
49
50
  const endpointMap = {
50
51
  // Text and image generation
@@ -59,8 +60,9 @@ function buildUrl(baseUrl, endpoint) {
59
60
  };
60
61
  const mapping = endpointMap[endpoint];
61
62
  if (mapping) {
62
- // For public API, treat as external (use proxy-style routes)
63
- const finalEndpoint = (isInternalApp && !isPublicApi) ? mapping.internal : mapping.external;
63
+ // For public API or external proxy, use external routes (without /auth/ prefix)
64
+ // Only internal app uses internal routes (with /auth/ prefix)
65
+ const finalEndpoint = isInternalApp && !isPublicApi && !isExternalProxy ? mapping.internal : mapping.external;
64
66
  return `${baseUrl}${finalEndpoint}`;
65
67
  }
66
68
  // Fallback for unmapped endpoints
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lastbrain/ai-ui-core",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "Framework-agnostic core library for LastBrain AI UI Kit",
5
5
  "private": false,
6
6
  "type": "module",
@@ -78,6 +78,7 @@ async function fetchWithRetry<T>(
78
78
  function buildUrl(baseUrl: string, endpoint: string): string {
79
79
  const isInternalApp = baseUrl.includes("/api/ai");
80
80
  const isPublicApi = baseUrl.includes("/api/public/v1");
81
+ const isExternalProxy = baseUrl.includes("/api/lastbrain");
81
82
 
82
83
  // Map endpoints for internal vs external context
83
84
  const endpointMap: Record<string, { internal: string; external: string }> = {
@@ -94,8 +95,10 @@ function buildUrl(baseUrl: string, endpoint: string): string {
94
95
 
95
96
  const mapping = endpointMap[endpoint];
96
97
  if (mapping) {
97
- // For public API, treat as external (use proxy-style routes)
98
- const finalEndpoint = (isInternalApp && !isPublicApi) ? mapping.internal : mapping.external;
98
+ // For public API or external proxy, use external routes (without /auth/ prefix)
99
+ // Only internal app uses internal routes (with /auth/ prefix)
100
+ const finalEndpoint =
101
+ isInternalApp && !isPublicApi && !isExternalProxy ? mapping.internal : mapping.external;
99
102
  return `${baseUrl}${finalEndpoint}`;
100
103
  }
101
104