@frankieai/react 0.2.3 → 0.2.5
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/dist/index.cjs +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/FrankieChatPage.tsx +11 -2
- package/src/hooks/useFrankieChat.ts +10 -2
- package/src/lib/client.ts +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -11,7 +11,7 @@ type PageContext = Record<string, string | number | boolean | null>;
|
|
|
11
11
|
* The hosted Frankie data plane. Embedding needs only a publishable key, so
|
|
12
12
|
* `baseUrl` defaults here — override it only when self-hosting the server.
|
|
13
13
|
*/
|
|
14
|
-
declare const FRANKIE_CLOUD_URL = "https://frankie-
|
|
14
|
+
declare const FRANKIE_CLOUD_URL = "https://frankie-control-665333762719.us-central1.run.app";
|
|
15
15
|
interface FrankieClientOptions {
|
|
16
16
|
/** Where the Frankie server is mounted. Defaults to the hosted cloud. */
|
|
17
17
|
baseUrl?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ type PageContext = Record<string, string | number | boolean | null>;
|
|
|
11
11
|
* The hosted Frankie data plane. Embedding needs only a publishable key, so
|
|
12
12
|
* `baseUrl` defaults here — override it only when self-hosting the server.
|
|
13
13
|
*/
|
|
14
|
-
declare const FRANKIE_CLOUD_URL = "https://frankie-
|
|
14
|
+
declare const FRANKIE_CLOUD_URL = "https://frankie-control-665333762719.us-central1.run.app";
|
|
15
15
|
interface FrankieClientOptions {
|
|
16
16
|
/** Where the Frankie server is mounted. Defaults to the hosted cloud. */
|
|
17
17
|
baseUrl?: string;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect2, useMemo, useRef as useRef2, useState as useState2 } from "react";
|
|
5
5
|
|
|
6
6
|
// src/lib/client.ts
|
|
7
|
-
var FRANKIE_CLOUD_URL = "https://frankie-
|
|
7
|
+
var FRANKIE_CLOUD_URL = "https://frankie-control-665333762719.us-central1.run.app";
|
|
8
8
|
var FrankieApiError = class extends Error {
|
|
9
9
|
constructor(message, status, code) {
|
|
10
10
|
super(message);
|
|
@@ -346,8 +346,11 @@ function useFrankieChatState() {
|
|
|
346
346
|
messagesRef.current = restoredMessages;
|
|
347
347
|
setMessages(restoredMessages);
|
|
348
348
|
}
|
|
349
|
-
} catch {
|
|
350
|
-
if (active)
|
|
349
|
+
} catch (caught) {
|
|
350
|
+
if (active) {
|
|
351
|
+
const message = caught instanceof FrankieApiError ? caught.message : caught instanceof Error && caught.message.startsWith("Frankie") ? caught.message : "Could not restore this conversation. Check your sign-in and connection, then try opening it again.";
|
|
352
|
+
setError(message);
|
|
353
|
+
}
|
|
351
354
|
} finally {
|
|
352
355
|
if (active) setRestored(true);
|
|
353
356
|
}
|
|
@@ -1372,8 +1375,12 @@ function PageChrome({ showHistory, navigation, currentId, onSelect, onNew, ...pa
|
|
|
1372
1375
|
try {
|
|
1373
1376
|
const items = await client.listConversations();
|
|
1374
1377
|
if (version === requestVersion.current) setConversations(items);
|
|
1375
|
-
} catch {
|
|
1376
|
-
if (version
|
|
1378
|
+
} catch (caught) {
|
|
1379
|
+
if (version !== requestVersion.current) {
|
|
1380
|
+
} else {
|
|
1381
|
+
const message = caught instanceof FrankieApiError ? caught.message : caught instanceof Error && caught.message.startsWith("Frankie") ? caught.message : "History couldn\u2019t load. Check your sign-in and try again.";
|
|
1382
|
+
setHistoryError(message);
|
|
1383
|
+
}
|
|
1377
1384
|
} finally {
|
|
1378
1385
|
if (version === requestVersion.current) setHistoryLoading(false);
|
|
1379
1386
|
}
|