orquesta-embed 0.1.8 → 0.1.9
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/components/EmbedPanel.d.ts +3 -1
- package/dist/core/auth.d.ts +52 -0
- package/dist/core/client.d.ts +7 -1
- package/dist/core/config.d.ts +16 -0
- package/dist/core/state.d.ts +10 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/vanilla.js +1 -1
- package/dist/vanilla.min.js +1 -1
- package/package.json +1 -1
|
@@ -16,6 +16,8 @@ interface EmbedPanelProps {
|
|
|
16
16
|
onLoadComments?: (promptId: string) => Promise<void>;
|
|
17
17
|
onAddComment?: (promptId: string, content: string) => Promise<void>;
|
|
18
18
|
onOverlayModeChange?: (mode: OverlayMode) => void;
|
|
19
|
+
onLogin?: () => Promise<void>;
|
|
20
|
+
onLogout?: () => Promise<void>;
|
|
19
21
|
}
|
|
20
|
-
export declare function EmbedPanel({ state, position, onClose, onMinimize, onSubmitPrompt, onSelectElement, onClearElement, onToggleConsole, onToggleNetwork, onTabChange, onExpandPrompt, onHighlightElement, onLoadComments, onAddComment, onOverlayModeChange }: EmbedPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function EmbedPanel({ state, position, onClose, onMinimize, onSubmitPrompt, onSelectElement, onClearElement, onToggleConsole, onToggleNetwork, onTabChange, onExpandPrompt, onHighlightElement, onLoadComments, onAddComment, onOverlayModeChange, onLogin, onLogout }: EmbedPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { EmbedUser, EmbedSession } from './config';
|
|
2
|
+
export interface AuthState {
|
|
3
|
+
isAuthenticated: boolean;
|
|
4
|
+
isAuthenticating: boolean;
|
|
5
|
+
user: EmbedUser | null;
|
|
6
|
+
sessionToken: string | null;
|
|
7
|
+
expiresAt: string | null;
|
|
8
|
+
authError: string | null;
|
|
9
|
+
}
|
|
10
|
+
export type AuthListener = (state: AuthState) => void;
|
|
11
|
+
export declare class AuthManager {
|
|
12
|
+
private token;
|
|
13
|
+
private apiUrl;
|
|
14
|
+
private state;
|
|
15
|
+
private listeners;
|
|
16
|
+
private popupWindow;
|
|
17
|
+
private messageHandler;
|
|
18
|
+
constructor(token: string, apiUrl: string);
|
|
19
|
+
private getInitialState;
|
|
20
|
+
getState(): AuthState;
|
|
21
|
+
private setState;
|
|
22
|
+
subscribe(listener: AuthListener): () => void;
|
|
23
|
+
private notify;
|
|
24
|
+
private getStorageKey;
|
|
25
|
+
private saveSession;
|
|
26
|
+
private loadSession;
|
|
27
|
+
private clearSession;
|
|
28
|
+
/**
|
|
29
|
+
* Check for existing session and validate it
|
|
30
|
+
*/
|
|
31
|
+
checkSession(): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Open popup for authentication
|
|
34
|
+
*/
|
|
35
|
+
login(): Promise<EmbedSession>;
|
|
36
|
+
private handleAuthSuccess;
|
|
37
|
+
private handleAuthError;
|
|
38
|
+
private cleanup;
|
|
39
|
+
/**
|
|
40
|
+
* Logout and clear session
|
|
41
|
+
*/
|
|
42
|
+
logout(): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Get current user if authenticated
|
|
45
|
+
*/
|
|
46
|
+
getUser(): EmbedUser | null;
|
|
47
|
+
/**
|
|
48
|
+
* Get session token for API calls
|
|
49
|
+
*/
|
|
50
|
+
getSessionToken(): string | null;
|
|
51
|
+
destroy(): void;
|
|
52
|
+
}
|
package/dist/core/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OrquestaEmbedConfig, Prompt, ElementContext, OverlayMode } from './config';
|
|
1
|
+
import type { OrquestaEmbedConfig, Prompt, ElementContext, OverlayMode, EmbedUser } from './config';
|
|
2
2
|
import { StateManager } from './state';
|
|
3
3
|
import { ConsoleCapture } from './console-capture';
|
|
4
4
|
import { NetworkCapture } from './network-capture';
|
|
@@ -12,6 +12,7 @@ export declare class OrquestaEmbedClient {
|
|
|
12
12
|
private consoleCapture;
|
|
13
13
|
private networkCapture;
|
|
14
14
|
private elementSelector;
|
|
15
|
+
private authManager;
|
|
15
16
|
private hotkeyHandler;
|
|
16
17
|
constructor(config: OrquestaEmbedConfig);
|
|
17
18
|
connect(): Promise<void>;
|
|
@@ -45,4 +46,9 @@ export declare class OrquestaEmbedClient {
|
|
|
45
46
|
x: number;
|
|
46
47
|
y: number;
|
|
47
48
|
}) => void): () => void;
|
|
49
|
+
login(): Promise<EmbedUser>;
|
|
50
|
+
logout(): Promise<void>;
|
|
51
|
+
isAuthenticated(): boolean;
|
|
52
|
+
getUser(): EmbedUser | null;
|
|
53
|
+
isAuthRequired(): boolean;
|
|
48
54
|
}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
export type Position = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
2
2
|
export type Theme = 'dark' | 'light' | 'auto';
|
|
3
3
|
export type Feature = 'prompts' | 'timeline' | 'deployments' | 'elements' | 'captures';
|
|
4
|
+
export interface EmbedUser {
|
|
5
|
+
id: string;
|
|
6
|
+
full_name: string | null;
|
|
7
|
+
avatar_url: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface EmbedSession {
|
|
10
|
+
user: EmbedUser;
|
|
11
|
+
sessionToken: string;
|
|
12
|
+
expiresAt: string;
|
|
13
|
+
}
|
|
4
14
|
export interface OrquestaEmbedConfig {
|
|
5
15
|
/** Embed token (oek_xxx) */
|
|
6
16
|
token: string;
|
|
@@ -18,10 +28,16 @@ export interface OrquestaEmbedConfig {
|
|
|
18
28
|
captureNetwork?: boolean;
|
|
19
29
|
/** Keyboard shortcut to toggle panel */
|
|
20
30
|
hotkey?: string;
|
|
31
|
+
/** Require login before submitting prompts */
|
|
32
|
+
requireAuth?: boolean;
|
|
21
33
|
/** Callback when SDK is ready */
|
|
22
34
|
onReady?: () => void;
|
|
23
35
|
/** Callback when prompt is submitted */
|
|
24
36
|
onPromptSubmit?: (promptId: string) => void;
|
|
37
|
+
/** Callback when user logs in */
|
|
38
|
+
onLogin?: (user: EmbedUser) => void;
|
|
39
|
+
/** Callback when user logs out */
|
|
40
|
+
onLogout?: () => void;
|
|
25
41
|
/** Callback on errors */
|
|
26
42
|
onError?: (error: Error) => void;
|
|
27
43
|
/** API base URL (defaults to https://orquesta.live) */
|
package/dist/core/state.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Prompt, ElementContext, ConsoleEntry, NetworkEntry, Comment, ElementMarker, OverlayMode } from './config';
|
|
1
|
+
import type { Prompt, ElementContext, ConsoleEntry, NetworkEntry, Comment, ElementMarker, OverlayMode, EmbedUser } from './config';
|
|
2
2
|
export interface EmbedState {
|
|
3
3
|
isConnected: boolean;
|
|
4
4
|
isConnecting: boolean;
|
|
@@ -6,6 +6,11 @@ export interface EmbedState {
|
|
|
6
6
|
projectId: string | null;
|
|
7
7
|
projectName: string | null;
|
|
8
8
|
agentOnline: boolean;
|
|
9
|
+
isAuthenticated: boolean;
|
|
10
|
+
isAuthenticating: boolean;
|
|
11
|
+
user: EmbedUser | null;
|
|
12
|
+
authError: string | null;
|
|
13
|
+
requireAuth: boolean;
|
|
9
14
|
isOpen: boolean;
|
|
10
15
|
activeTab: 'prompts' | 'timeline';
|
|
11
16
|
isSelectingElement: boolean;
|
|
@@ -67,5 +72,9 @@ export declare class StateManager {
|
|
|
67
72
|
addNetworkLogs(logs: NetworkEntry[]): void;
|
|
68
73
|
toggleIncludeConsole(): void;
|
|
69
74
|
toggleIncludeNetwork(): void;
|
|
75
|
+
setAuth(user: EmbedUser | null, isAuthenticated: boolean): void;
|
|
76
|
+
setAuthenticating(isAuthenticating: boolean): void;
|
|
77
|
+
setAuthError(error: string | null): void;
|
|
78
|
+
setRequireAuth(requireAuth: boolean): void;
|
|
70
79
|
reset(): void;
|
|
71
80
|
}
|