@merit-systems/echo-react-sdk 1.0.24 → 1.0.25
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 +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -2
- package/dist/index.d.ts +26 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -6
- package/dist/EchoProvider-BcTF2ono.cjs +0 -11
- package/dist/EchoProvider-BcTF2ono.cjs.map +0 -1
- package/dist/EchoProvider-vBCJ8CGx.js +0 -32452
- package/dist/EchoProvider-vBCJ8CGx.js.map +0 -1
- package/dist/advanced.cjs +0 -2
- package/dist/advanced.cjs.map +0 -1
- package/dist/advanced.d.ts +0 -38
- package/dist/advanced.js +0 -5
- package/dist/advanced.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { ReactNode } from 'react';
|
|
4
|
+
import { User } from 'oidc-client-ts';
|
|
4
5
|
import * as _merit_systems_echo_typescript_sdk from '@merit-systems/echo-typescript-sdk';
|
|
5
6
|
import { EchoConfig, Balance, EchoClient, FreeBalance } from '@merit-systems/echo-typescript-sdk';
|
|
6
|
-
import { User } from 'oidc-client-ts';
|
|
7
7
|
import * as openai from 'openai';
|
|
8
8
|
import * as ai from 'ai';
|
|
9
9
|
import { ChatTransport, UIMessage, ModelMessage, UIMessageChunk } from 'ai';
|
|
@@ -45,6 +45,30 @@ interface EchoTokensProps {
|
|
|
45
45
|
showAvatar?: boolean;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
interface EchoProviderRawProps {
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
config: EchoAuthConfig;
|
|
51
|
+
isAuthLoading: boolean;
|
|
52
|
+
authError: Error | null | undefined;
|
|
53
|
+
rawUser: User | null | undefined;
|
|
54
|
+
isLoggedIn: boolean;
|
|
55
|
+
signIn: () => Promise<void>;
|
|
56
|
+
signOut: () => Promise<void>;
|
|
57
|
+
getToken: () => Promise<string | null>;
|
|
58
|
+
echoClient: EchoClient | null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Raw provider that manages Echo context without built-in authentication.
|
|
62
|
+
*
|
|
63
|
+
* Design: Single internal context with useEcho() hook for both SDK and client components.
|
|
64
|
+
* Accepts auth state/methods from parent, enabling custom auth implementations (Next.js proxy, etc).
|
|
65
|
+
*
|
|
66
|
+
* @param rawUser - OIDC user object from parent auth provider
|
|
67
|
+
* @param isLoggedIn - Auth state from parent
|
|
68
|
+
* @param signIn/signOut/getToken - Auth methods from parent
|
|
69
|
+
* @param echoClient - Configured Echo API client
|
|
70
|
+
*/
|
|
71
|
+
declare function EchoProviderRaw({ config, children, isAuthLoading, authError, rawUser, isLoggedIn, signIn, signOut, getToken, echoClient, }: EchoProviderRawProps): react_jsx_runtime.JSX.Element;
|
|
48
72
|
interface EchoProviderProps {
|
|
49
73
|
config: EchoAuthConfig;
|
|
50
74
|
children: ReactNode;
|
|
@@ -137,4 +161,4 @@ interface EchoContextValue {
|
|
|
137
161
|
}
|
|
138
162
|
declare const EchoContext: React$1.Context<EchoContextValue | null>;
|
|
139
163
|
|
|
140
|
-
export { type EchoBalance, EchoChatProvider, type EchoAuthConfig as EchoConfig, EchoContext, type EchoContextValue, EchoProvider, EchoSignIn, type EchoSignInProps, EchoSignOut, type EchoSignOutProps, EchoTokens, type EchoTokensProps, type EchoUser, InsufficientFundsModal, Logo, useChat, useEcho, useEchoClient, useEchoModelProviders, useEchoOpenAI };
|
|
164
|
+
export { type EchoBalance, EchoChatProvider, type EchoAuthConfig as EchoConfig, EchoContext, type EchoContextValue, EchoProvider, EchoProviderRaw, type EchoProviderRawProps, EchoSignIn, type EchoSignInProps, EchoSignOut, type EchoSignOutProps, EchoTokens, type EchoTokensProps, type EchoUser, InsufficientFundsModal, Logo, useChat, useEcho, useEchoClient, useEchoModelProviders, useEchoOpenAI };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { ReactNode } from 'react';
|
|
4
|
+
import { User } from 'oidc-client-ts';
|
|
4
5
|
import * as _merit_systems_echo_typescript_sdk from '@merit-systems/echo-typescript-sdk';
|
|
5
6
|
import { EchoConfig, Balance, EchoClient, FreeBalance } from '@merit-systems/echo-typescript-sdk';
|
|
6
|
-
import { User } from 'oidc-client-ts';
|
|
7
7
|
import * as openai from 'openai';
|
|
8
8
|
import * as ai from 'ai';
|
|
9
9
|
import { ChatTransport, UIMessage, ModelMessage, UIMessageChunk } from 'ai';
|
|
@@ -45,6 +45,30 @@ interface EchoTokensProps {
|
|
|
45
45
|
showAvatar?: boolean;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
interface EchoProviderRawProps {
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
config: EchoAuthConfig;
|
|
51
|
+
isAuthLoading: boolean;
|
|
52
|
+
authError: Error | null | undefined;
|
|
53
|
+
rawUser: User | null | undefined;
|
|
54
|
+
isLoggedIn: boolean;
|
|
55
|
+
signIn: () => Promise<void>;
|
|
56
|
+
signOut: () => Promise<void>;
|
|
57
|
+
getToken: () => Promise<string | null>;
|
|
58
|
+
echoClient: EchoClient | null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Raw provider that manages Echo context without built-in authentication.
|
|
62
|
+
*
|
|
63
|
+
* Design: Single internal context with useEcho() hook for both SDK and client components.
|
|
64
|
+
* Accepts auth state/methods from parent, enabling custom auth implementations (Next.js proxy, etc).
|
|
65
|
+
*
|
|
66
|
+
* @param rawUser - OIDC user object from parent auth provider
|
|
67
|
+
* @param isLoggedIn - Auth state from parent
|
|
68
|
+
* @param signIn/signOut/getToken - Auth methods from parent
|
|
69
|
+
* @param echoClient - Configured Echo API client
|
|
70
|
+
*/
|
|
71
|
+
declare function EchoProviderRaw({ config, children, isAuthLoading, authError, rawUser, isLoggedIn, signIn, signOut, getToken, echoClient, }: EchoProviderRawProps): react_jsx_runtime.JSX.Element;
|
|
48
72
|
interface EchoProviderProps {
|
|
49
73
|
config: EchoAuthConfig;
|
|
50
74
|
children: ReactNode;
|
|
@@ -137,4 +161,4 @@ interface EchoContextValue {
|
|
|
137
161
|
}
|
|
138
162
|
declare const EchoContext: React$1.Context<EchoContextValue | null>;
|
|
139
163
|
|
|
140
|
-
export { type EchoBalance, EchoChatProvider, type EchoAuthConfig as EchoConfig, EchoContext, type EchoContextValue, EchoProvider, EchoSignIn, type EchoSignInProps, EchoSignOut, type EchoSignOutProps, EchoTokens, type EchoTokensProps, type EchoUser, InsufficientFundsModal, Logo, useChat, useEcho, useEchoClient, useEchoModelProviders, useEchoOpenAI };
|
|
164
|
+
export { type EchoBalance, EchoChatProvider, type EchoAuthConfig as EchoConfig, EchoContext, type EchoContextValue, EchoProvider, EchoProviderRaw, type EchoProviderRawProps, EchoSignIn, type EchoSignInProps, EchoSignOut, type EchoSignOutProps, EchoTokens, type EchoTokensProps, type EchoUser, InsufficientFundsModal, Logo, useChat, useEcho, useEchoClient, useEchoModelProviders, useEchoOpenAI };
|
package/dist/index.js
CHANGED
|
@@ -136366,6 +136366,7 @@ export {
|
|
|
136366
136366
|
EchoChatProvider,
|
|
136367
136367
|
EchoContext,
|
|
136368
136368
|
EchoProvider,
|
|
136369
|
+
EchoProviderRaw,
|
|
136369
136370
|
EchoSignIn,
|
|
136370
136371
|
EchoSignOut,
|
|
136371
136372
|
EchoTokens,
|