@cagent/chat-embedding-core 0.0.14 → 0.0.21
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.
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSO for chatflows that need a signed-in C-Gov user. The C-Agent server does the OIDC exchange; this module only
|
|
3
|
+
* starts a login, waits for the result and keeps the short-lived C-Agent session token. SSO tokens never reach the page.
|
|
4
|
+
*/
|
|
5
|
+
export type SsoStatus = 'not_required' | 'checking' | 'needs_login' | 'signing_in' | 'failed' | 'ready';
|
|
6
|
+
export declare const clearSsoSession: () => void;
|
|
7
|
+
export declare const getSsoToken: () => string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Login without any user action: a hidden frame asks the SSO server with prompt=none. It only succeeds when the browser
|
|
10
|
+
* sends the SSO cookie inside the frame; otherwise the caller falls back to the popup.
|
|
11
|
+
*/
|
|
12
|
+
export declare const trySilentSignIn: (apiHost: string) => Promise<boolean>;
|
|
13
|
+
/** Browsers only allow a popup inside the click that asked for it, so this must run before any await. */
|
|
14
|
+
export declare const openLoginPopup: () => Window | null;
|
|
15
|
+
/**
|
|
16
|
+
* The popup is not watched for closing: under Cross-Origin-Opener-Policy `popup.closed` turns true as soon as the SSO
|
|
17
|
+
* page loads, so the only reliable signal is the server-side result.
|
|
18
|
+
*/
|
|
19
|
+
export declare const signInWithPopup: (apiHost: string, popup: Window | null) => Promise<boolean>;
|