Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/etc/components-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export interface ReceivedDataMessage<T extends string | undefined = string> exte
from?: Participant;
}

// @public (undocumented)
// @beta (undocumented)
export type ReceivedMessage = ReceivedUserTranscriptionMessage | ReceivedAgentTranscriptionMessage | ReceivedChatMessage;

// @public (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/messages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export type ReceivedAgentTranscriptionMessage = ReceivedMessageWithType<
}
>;

/** @public */
/** @beta */
export type ReceivedMessage =
| ReceivedUserTranscriptionMessage
| ReceivedAgentTranscriptionMessage
Expand Down
42 changes: 21 additions & 21 deletions packages/react/etc/components-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ import { TranscriptionSegment } from 'livekit-client';
import { VideoCaptureOptions } from 'livekit-client';
import { WidgetState } from '@livekit/components-core';

// @public (undocumented)
// @beta (undocumented)
export type AgentCallbacks = {
[AgentEvent.CameraChanged]: (newTrack: TrackReference | undefined) => void;
[AgentEvent.MicrophoneChanged]: (newTrack: TrackReference | undefined) => void;
[AgentEvent.StateChanged]: (newAgentState: AgentState) => void;
};

// @public (undocumented)
// @beta (undocumented)
export enum AgentEvent {
// (undocumented)
CameraChanged = "cameraChanged",
Expand All @@ -91,7 +91,7 @@ export enum AgentEvent {

// Warning: (ae-forgotten-export) The symbol "AgentSdkStates" needs to be exported by the entry point index.docs.d.ts
//
// @public
// @beta
export type AgentState = 'disconnected' | 'connecting' | 'pre-connect-buffering' | 'failed' | AgentSdkStates;

// @public (undocumented)
Expand Down Expand Up @@ -486,12 +486,12 @@ export { MessageEncoder }
// @public (undocumented)
export type MessageFormatter = (message: string) => React_2.ReactNode;

// @public (undocumented)
// @beta (undocumented)
export type MessagesCallbacks = {
[MessagesEvent.MessageReceived]: (message: ReceivedMessage) => void;
};

// @public (undocumented)
// @beta (undocumented)
export enum MessagesEvent {
MessageReceived = "messageReceived"
}
Expand Down Expand Up @@ -654,14 +654,14 @@ export const ScreenShareIcon: (props: SVGProps<SVGSVGElement>) => React_2.JSX.El
// @internal (undocumented)
export const ScreenShareStopIcon: (props: SVGProps<SVGSVGElement>) => React_2.JSX.Element;

// @public (undocumented)
// @beta (undocumented)
export type SessionCallbacks = {
[SessionEvent.ConnectionStateChanged]: (newAgentConnectionState: ConnectionState_2) => void;
[SessionEvent.MediaDevicesError]: (error: Error) => void;
[SessionEvent.EncryptionError]: (error: Error) => void;
};

// @public (undocumented)
// @beta (undocumented)
export type SessionConnectOptions = {
signal?: AbortSignal;
tracks?: {
Expand All @@ -673,18 +673,18 @@ export type SessionConnectOptions = {
roomConnectOptions?: RoomConnectOptions;
};

// @public (undocumented)
// @beta (undocumented)
export enum SessionEvent {
// (undocumented)
ConnectionStateChanged = "connectionStateChanged",
EncryptionError = "encryptionError",
MediaDevicesError = "mediaDevicesError"
}

// @public
// @beta
export function SessionProvider(props: SessionProviderProps): React_2.JSX.Element;

// @public (undocumented)
// @beta (undocumented)
export type SessionProviderProps = {
session: UseSessionReturn;
children: React_2.ReactNode;
Expand All @@ -705,7 +705,7 @@ export const StartAudio: (props: AllowAudioPlaybackProps & React_2.RefAttributes
// @public
export const StartMediaButton: (props: AllowMediaPlaybackProps & React_2.RefAttributes<HTMLButtonElement>) => React_2.ReactNode;

// @public (undocumented)
// @beta (undocumented)
export type SwitchActiveDeviceOptions = {
exact?: boolean;
};
Expand Down Expand Up @@ -782,13 +782,13 @@ export const UnfocusToggleIcon: (props: SVGProps<SVGSVGElement>) => React_2.JSX.

// Warning: (ae-forgotten-export) The symbol "SessionStub" needs to be exported by the entry point index.docs.d.ts
//
// @public
// @beta
export function useAgent(session?: SessionStub): UseAgentReturn;

// Warning: (ae-forgotten-export) The symbol "AgentStateCases" needs to be exported by the entry point index.docs.d.ts
// Warning: (ae-forgotten-export) The symbol "AgentActions" needs to be exported by the entry point index.docs.d.ts
//
// @public (undocumented)
// @beta (undocumented)
export type UseAgentReturn = AgentStateCases & AgentActions;

// @alpha
Expand Down Expand Up @@ -877,7 +877,7 @@ export function useEnsureParticipant(participant?: Participant): Participant;
// @public
export function useEnsureRoom(room?: Room): Room;

// @public
// @beta
export function useEnsureSession(session?: UseSessionReturn): UseSessionReturn;

// @public
Expand Down Expand Up @@ -1004,7 +1004,7 @@ export function useMaybeParticipantContext(): Participant | undefined;
// @public
export function useMaybeRoomContext(): Room | undefined;

// @public
// @beta
export function useMaybeSessionContext(): UseSessionReturn | undefined;

// @public
Expand Down Expand Up @@ -1206,21 +1206,21 @@ export type UseSequentialRoomConnectDisconnectResults<R extends Room | undefined

// Warning: (ae-forgotten-export) The symbol "UseSessionConfigurableOptions" needs to be exported by the entry point index.docs.d.ts
//
// @public
// @beta
export function useSession(tokenSource: TokenSourceConfigurable, options?: UseSessionConfigurableOptions): UseSessionReturn;

// Warning: (ae-forgotten-export) The symbol "UseSessionFixedOptions" needs to be exported by the entry point index.docs.d.ts
//
// @public
// @beta
export function useSession(tokenSource: TokenSourceFixed, options?: UseSessionFixedOptions): UseSessionReturn;

// @public
// @beta
export function useSessionContext(): UseSessionReturn;

// @public (undocumented)
// @beta (undocumented)
export function useSessionMessages(session?: UseSessionReturn): UseSessionMessagesReturn;

// @public (undocumented)
// @beta (undocumented)
export type UseSessionMessagesReturn = {
messages: Array<ReceivedMessage>;
isSending: boolean;
Expand All @@ -1235,7 +1235,7 @@ export type UseSessionMessagesReturn = {
// Warning: (ae-forgotten-export) The symbol "SessionStateDisconnected" needs to be exported by the entry point index.docs.d.ts
// Warning: (ae-forgotten-export) The symbol "SessionActions" needs to be exported by the entry point index.docs.d.ts
//
// @public (undocumented)
// @beta (undocumented)
export type UseSessionReturn = (SessionStateConnecting | SessionStateConnected | SessionStateDisconnected) & SessionActions;

// @public
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/SessionProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { UseSessionReturn } from '../hooks';
import { RoomContext } from '../context';
import { SessionContext } from '../context/session-context';

/** @public */
/** @beta */
export type SessionProviderProps = {
session: UseSessionReturn;
children: React.ReactNode;
};

/**
* The `SessionProvider` component instantiates a SessionContext from the return of useSession
* @public
* @beta
*/
export function SessionProvider(props: SessionProviderProps) {
return (
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/context/session-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const SessionContext = React.createContext<UseSessionReturn | undefined>(
/**
* Ensures that a session is provided via context.
* If no session is provided, an error is thrown.
* @public
* @beta
*/
export function useSessionContext() {
const ctx = React.useContext(SessionContext);
Expand All @@ -20,7 +20,7 @@ export function useSessionContext() {

/**
* Returns the session context if it exists, otherwise undefined.
* @public
* @beta
*/
export function useMaybeSessionContext() {
return React.useContext(SessionContext);
Expand All @@ -29,7 +29,7 @@ export function useMaybeSessionContext() {
/**
* Ensures that a session is provided, either via context or explicitly as a parameter.
* If no session is provided, an error is thrown.
* @public
* @beta
*/
export function useEnsureSession(session?: UseSessionReturn) {
const context = useMaybeSessionContext();
Expand Down
10 changes: 5 additions & 5 deletions packages/react/src/hooks/useAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type AgentSdkStates = 'initializing' | 'idle' | 'listening' | 'thinking' | 'spea
* Legacy useVoiceAssistant hook:
* disconnected ➡️ connecting ➡️ initializing ➡️ listening/thinking/speaking
*
* @public
* @beta
* */
export type AgentState =
| 'disconnected'
Expand All @@ -47,14 +47,14 @@ export type AgentState =
| 'failed'
| AgentSdkStates;

/** @public */
/** @beta */
export enum AgentEvent {
CameraChanged = 'cameraChanged',
MicrophoneChanged = 'microphoneChanged',
StateChanged = 'stateChanged',
}

/** @public */
/** @beta */
export type AgentCallbacks = {
[AgentEvent.CameraChanged]: (newTrack: TrackReference | undefined) => void;
[AgentEvent.MicrophoneChanged]: (newTrack: TrackReference | undefined) => void;
Expand Down Expand Up @@ -253,7 +253,7 @@ type AgentStateCases =
| AgentStateUnAvailable
| AgentStateFailed;

/** @public */
/** @beta */
export type UseAgentReturn = AgentStateCases & AgentActions;

const generateDerivedStateValues = <State extends AgentState>(state: State) =>
Expand Down Expand Up @@ -460,7 +460,7 @@ function useAgentWaitUntilDerivedStates(

/**
* useAgent encapculates all agent state, normalizing some quirks around how LiveKit Agents work.
* @public
* @beta
*/
export function useAgent(session?: SessionStub): UseAgentReturn {
const sessionFromContext = useMaybeSessionContext();
Expand Down
14 changes: 7 additions & 7 deletions packages/react/src/hooks/useSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { AgentState, useAgent, useAgentTimeoutIdStore } from './useAgent';
import { TrackReference } from '@livekit/components-core';
import { useLocalParticipant } from './useLocalParticipant';

/** @public */
/** @beta */
export enum SessionEvent {
ConnectionStateChanged = 'connectionStateChanged',
/**
Expand All @@ -35,14 +35,14 @@ export enum SessionEvent {
EncryptionError = 'encryptionError',
}

/** @public */
/** @beta */
export type SessionCallbacks = {
[SessionEvent.ConnectionStateChanged]: (newAgentConnectionState: ConnectionState) => void;
[SessionEvent.MediaDevicesError]: (error: Error) => void;
[SessionEvent.EncryptionError]: (error: Error) => void;
};

/** @public */
/** @beta */
export type SessionConnectOptions = {
/** Optional abort signal which if triggered will terminate connecting even if it isn't complete */
signal?: AbortSignal;
Expand All @@ -58,7 +58,7 @@ export type SessionConnectOptions = {
roomConnectOptions?: RoomConnectOptions;
};

/** @public */
/** @beta */
export type SwitchActiveDeviceOptions = {
/**
* If true, adds an `exact` constraint to the getUserMedia request.
Expand Down Expand Up @@ -130,7 +130,7 @@ type SessionActions = {
end: () => Promise<void>;
};

/** @public */
/** @beta */
export type UseSessionReturn = (
| SessionStateConnecting
| SessionStateConnected
Expand Down Expand Up @@ -280,15 +280,15 @@ function useSessionTokenSourceFetch(

/**
* A Session represents a managed connection to a Room which can contain Agents.
* @public
* @beta
*/
export function useSession(
tokenSource: TokenSourceConfigurable,
options?: UseSessionConfigurableOptions,
): UseSessionReturn;
/**
* A Session represents a managed connection to a Room which can contain Agents.
* @public
* @beta
*/
export function useSession(
tokenSource: TokenSourceFixed,
Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/hooks/useSessionMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useChat } from './useChat';
import { UseSessionReturn } from './useSession';
import { useEnsureSession } from '../context';

/** @public */
/** @beta */
export type UseSessionMessagesReturn = {
messages: Array<ReceivedMessage>;

Expand All @@ -30,7 +30,7 @@ export type UseSessionMessagesReturn = {
};
};

/** @public */
/** @beta */
export enum MessagesEvent {
/**
* Emits when a new message is received from a participant
Expand All @@ -39,12 +39,12 @@ export enum MessagesEvent {
MessageReceived = 'messageReceived',
}

/** @public */
/** @beta */
export type MessagesCallbacks = {
[MessagesEvent.MessageReceived]: (message: ReceivedMessage) => void;
};

/** @public */
/** @beta */
export function useSessionMessages(session?: UseSessionReturn): UseSessionMessagesReturn {
const { room } = useEnsureSession(session);

Expand Down
Loading