@livekit/components-js-docs 0.1.74 → 0.1.77
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/generated-docs/core/createdataobserver.md +1 -1
- package/generated-docs/core/createemailregexp.md +1 -1
- package/generated-docs/core/grid_layouts.md +1 -1
- package/generated-docs/core/index.md +146 -146
- package/generated-docs/core/participantagentattributes.md +1 -0
- package/generated-docs/core/participantbyidentifierobserver.md +1 -1
- package/generated-docs/core/pin_default_state.md +1 -1
- package/generated-docs/core/receivedmessage.md +1 -3
- package/generated-docs/core/setupdatamessagehandler.md +1 -1
- package/generated-docs/core/sorttrackreferences.md +1 -1
- package/generated-docs/core/widget_default_state.md +1 -1
- package/generated-docs/react/agentmood.md +37 -0
- package/generated-docs/react/agentstate.md +1 -5
- package/generated-docs/react/default_mood_ttl_turns.md +24 -0
- package/generated-docs/react/expression_attribute.md +24 -0
- package/generated-docs/react/hook/useagentexpression.md +46 -0
- package/generated-docs/react/hook/usechattoggle.md +1 -1
- package/generated-docs/react/hook/usefocustoggle.md +2 -2
- package/generated-docs/react/hook/usemediadevices.md +1 -1
- package/generated-docs/react/hook/usemediadeviceselect.md +5 -5
- package/generated-docs/react/hook/useparticipanttile.md +4 -4
- package/generated-docs/react/hook/usestartaudio.md +2 -2
- package/generated-docs/react/hook/usestartvideo.md +2 -2
- package/generated-docs/react/hook/usetracktoggle.md +1 -1
- package/generated-docs/react/index.md +140 -133
- package/generated-docs/react/meta-data.json +1 -1
- package/generated-docs/react/parseexpression.md +24 -0
- package/generated-docs/react/useagentexpressionoptions.md +30 -0
- package/generated-docs/react/useagentexpressionoptions.ttlturns.md +21 -0
- package/generated-docs/react/useagentexpressionreturn.expression.md +21 -0
- package/generated-docs/react/useagentexpressionreturn.md +29 -0
- package/generated-docs/react/useagentexpressionreturn.mood.md +21 -0
- package/generated-docs/react/usesessionreturn.md +1 -3
- package/package.json +2 -2
|
@@ -22,6 +22,7 @@ export declare enum ParticipantAgentAttributes
|
|
|
22
22
|
| Member | Value | Description |
|
|
23
23
|
| ---------------------- | ------------------------------------------------ | ----------- |
|
|
24
24
|
| AgentState | <code>"lk.agent.state"</code> | |
|
|
25
|
+
| Expression | <code>"lk.expression"</code> | |
|
|
25
26
|
| PublishOnBehalf | <code>"lk.publish_on_behalf"</code> | |
|
|
26
27
|
| TranscribedTrackId | <code>"lk.transcribed_track_id"</code> | |
|
|
27
28
|
| TranscriptionFinal | <code>"lk.transcription_final"</code> | |
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
```typescript
|
|
15
15
|
export declare function participantByIdentifierObserver(
|
|
16
16
|
room: Room,
|
|
17
|
-
|
|
17
|
+
input: ParticipantIdentifier,
|
|
18
18
|
options?: ConnectedParticipantObserverOptions
|
|
19
19
|
): Observable<RemoteParticipant | undefined>;
|
|
20
20
|
```
|
|
@@ -19,9 +19,7 @@ This feature is under active development and may change based on developer feedb
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
export type ReceivedMessage =
|
|
22
|
-
|
|
|
23
|
-
| ReceivedAgentTranscriptionMessage
|
|
24
|
-
| ReceivedChatMessage;
|
|
22
|
+
ReceivedUserTranscriptionMessage | ReceivedAgentTranscriptionMessage | ReceivedChatMessage;
|
|
25
23
|
```
|
|
26
24
|
|
|
27
25
|
**References:** [ReceivedUserTranscriptionMessage](./core/receivedusertranscriptionmessage.md)<!-- -->, [ReceivedAgentTranscriptionMessage](./core/receivedagenttranscriptionmessage.md)<!-- -->, [ReceivedChatMessage](./core/receivedchatmessage.md)
|
|
@@ -18,7 +18,7 @@ export declare function setupDataMessageHandler<T extends string>(
|
|
|
18
18
|
onMessage?: (msg: ReceivedDataMessage<T>) => void
|
|
19
19
|
): {
|
|
20
20
|
messageObservable: Observable<{
|
|
21
|
-
payload: Uint8Array<
|
|
21
|
+
payload: Uint8Array<ArrayBuffer>;
|
|
22
22
|
topic: T;
|
|
23
23
|
from: import("livekit-client").RemoteParticipant | undefined;
|
|
24
24
|
}>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
# sortTrackReferences
|
|
11
11
|
|
|
12
|
-
Default sort for `TrackReferenceOrPlaceholder`<!-- -->, it'll order participants by: 1. local camera track (publication.isLocal) 2. remote
|
|
12
|
+
Default sort for `TrackReferenceOrPlaceholder`<!-- -->, it'll order participants by: 1. local camera track (publication.isLocal) 2. remote screen\_share track 3. local screen\_share track 4. remote dominant speaker camera track (sorted by speaker with the loudest audio level) 5. other remote speakers that are recently active 6. remote unmuted camera tracks 7. remote tracks sorted by joinedAt
|
|
13
13
|
|
|
14
14
|
**Signature:**
|
|
15
15
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "AgentMood type",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useAgentExpression.ts"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# AgentMood type
|
|
11
|
+
|
|
12
|
+
{% callout type="note" variation="normal" %}
|
|
13
|
+
|
|
14
|
+
This feature is under active development and may change based on developer feedback and real-world usage.
|
|
15
|
+
|
|
16
|
+
{% /callout %}
|
|
17
|
+
|
|
18
|
+
The agent's normalized emotional delivery.
|
|
19
|
+
|
|
20
|
+
The wording the TTS provider emits is not a fixed vocabulary: Fish Audio emits single words from a closed set, Inworld emits free-form English ("soft, with genuine care"), and models routinely drift outside whichever set they were given. The agent normalizes that wording to this enum before publishing it, so every client SDK reads the same values.
|
|
21
|
+
|
|
22
|
+
**Signature:**
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
export type AgentMood =
|
|
26
|
+
| "excited"
|
|
27
|
+
| "happy"
|
|
28
|
+
| "playful"
|
|
29
|
+
| "curious"
|
|
30
|
+
| "surprised"
|
|
31
|
+
| "hopeful"
|
|
32
|
+
| "empathetic"
|
|
33
|
+
| "sad"
|
|
34
|
+
| "angry"
|
|
35
|
+
| "anxious"
|
|
36
|
+
| "calm";
|
|
37
|
+
```
|
|
@@ -29,9 +29,5 @@ Legacy useVoiceAssistant hook: disconnected ➡️ connecting ➡️ initializin
|
|
|
29
29
|
|
|
30
30
|
```typescript
|
|
31
31
|
export type AgentState =
|
|
32
|
-
| "
|
|
33
|
-
| "connecting"
|
|
34
|
-
| "pre-connect-buffering"
|
|
35
|
-
| "failed"
|
|
36
|
-
| AgentSdkStates;
|
|
32
|
+
"disconnected" | "connecting" | "pre-connect-buffering" | "failed" | AgentSdkStates;
|
|
37
33
|
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "DEFAULT_MOOD_TTL_TURNS",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useAgentExpression.ts"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# DEFAULT\_MOOD\_TTL\_TURNS
|
|
11
|
+
|
|
12
|
+
{% callout type="note" variation="normal" %}
|
|
13
|
+
|
|
14
|
+
This feature is under active development and may change based on developer feedback and real-world usage.
|
|
15
|
+
|
|
16
|
+
{% /callout %}
|
|
17
|
+
|
|
18
|
+
How many agent turns an expression survives before the mood decays back to null. Without decay, one excited sentence would leave the UI excited for the rest of the session.
|
|
19
|
+
|
|
20
|
+
**Signature:**
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
DEFAULT_MOOD_TTL_TURNS = 2;
|
|
24
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "EXPRESSION_ATTRIBUTE",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useAgentExpression.ts"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# EXPRESSION\_ATTRIBUTE
|
|
11
|
+
|
|
12
|
+
{% callout type="note" variation="normal" %}
|
|
13
|
+
|
|
14
|
+
This feature is under active development and may change based on developer feedback and real-world usage.
|
|
15
|
+
|
|
16
|
+
{% /callout %}
|
|
17
|
+
|
|
18
|
+
Published per transcript segment by Expressive Mode: the segment's leading delivery tag.
|
|
19
|
+
|
|
20
|
+
**Signature:**
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
EXPRESSION_ATTRIBUTE: "lk.expression";
|
|
24
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "useAgentExpression",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useAgentExpression.ts"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# useAgentExpression
|
|
11
|
+
|
|
12
|
+
{% callout type="note" variation="normal" %}
|
|
13
|
+
|
|
14
|
+
This feature is under active development and may change based on developer feedback and real-world usage.
|
|
15
|
+
|
|
16
|
+
{% /callout %}
|
|
17
|
+
|
|
18
|
+
useAgentExpression returns the agent's current emotional delivery, as published by Expressive Mode.
|
|
19
|
+
|
|
20
|
+
Reads the transcript stream the session already subscribes to, so it adds no second text stream handler. The mood decays back to null after `ttlTurns` agent turns without a new expression, so a feeling doesn't outlive the moment that produced it.
|
|
21
|
+
|
|
22
|
+
## Import
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { useAgentExpression } from "@livekit/components-react";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
const { mood, expression } = useAgentExpression();
|
|
32
|
+
return <span title={expression ?? undefined}>{mood ?? "neutral"}</span>;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Properties
|
|
36
|
+
|
|
37
|
+
{% parameter name="opts.ttlTurns" type="number" optional=true %}
|
|
38
|
+
Agent turns an expression survives before the mood decays to null. `0` disables decay.
|
|
39
|
+
|
|
40
|
+
{% /parameter %}
|
|
41
|
+
|
|
42
|
+
## Returns
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
UseAgentExpressionReturn;
|
|
46
|
+
```
|
|
@@ -23,7 +23,7 @@ Depends on the `LayoutContext` to work properly.
|
|
|
23
23
|
|
|
24
24
|
## Properties
|
|
25
25
|
|
|
26
|
-
{% parameter name="
|
|
26
|
+
{% parameter name="input.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
|
|
27
27
|
{% /parameter %}
|
|
28
28
|
|
|
29
29
|
## Returns
|
|
@@ -26,10 +26,10 @@ return <button {...mergedProps}>{inFocus ? "Unfocus" : "Focus"}</button>;
|
|
|
26
26
|
|
|
27
27
|
## Properties
|
|
28
28
|
|
|
29
|
-
{% parameter name="
|
|
29
|
+
{% parameter name="input.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
|
|
30
30
|
{% /parameter %}
|
|
31
31
|
|
|
32
|
-
{% parameter name="
|
|
32
|
+
{% parameter name="input.trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
|
|
33
33
|
{% /parameter %}
|
|
34
34
|
|
|
35
35
|
## Returns
|
|
@@ -27,23 +27,23 @@ const { devices, activeDeviceId, setActiveMediaDevice } = useMediaDeviceSelect({
|
|
|
27
27
|
|
|
28
28
|
## Properties
|
|
29
29
|
|
|
30
|
-
{% parameter name="
|
|
30
|
+
{% parameter name="input.kind" type="MediaDeviceKind" optional=false %}
|
|
31
31
|
{% /parameter %}
|
|
32
32
|
|
|
33
|
-
{% parameter name="
|
|
33
|
+
{% parameter name="input.onError" type="(e: Error) => void" optional=true %}
|
|
34
34
|
this callback gets called if an error is thrown when failing to select a device and also if a user denied permissions, eventhough the `requestPermissions` option is set to `true`<!-- -->. Most commonly this will emit a MediaDeviceError
|
|
35
35
|
|
|
36
36
|
{% /parameter %}
|
|
37
37
|
|
|
38
|
-
{% parameter name="
|
|
38
|
+
{% parameter name="input.requestPermissions" type="boolean" optional=true %}
|
|
39
39
|
this will call getUserMedia if the permissions are not yet given to enumerate the devices with device labels. in some browsers multiple calls to getUserMedia result in multiple permission prompts. It's generally advised only flip this to true, once a (preview) track has been acquired successfully with the appropriate permissions.
|
|
40
40
|
|
|
41
41
|
{% /parameter %}
|
|
42
42
|
|
|
43
|
-
{% parameter name="
|
|
43
|
+
{% parameter name="input.room" type="Room" optional=true %}
|
|
44
44
|
{% /parameter %}
|
|
45
45
|
|
|
46
|
-
{% parameter name="
|
|
46
|
+
{% parameter name="input.track" type="LocalAudioTrack | LocalVideoTrack" optional=true %}
|
|
47
47
|
{% /parameter %}
|
|
48
48
|
|
|
49
49
|
## Returns
|
|
@@ -23,16 +23,16 @@ The returned props include many data attributes that are useful for CSS styling
|
|
|
23
23
|
|
|
24
24
|
## Properties
|
|
25
25
|
|
|
26
|
-
{% parameter name="
|
|
26
|
+
{% parameter name="input.htmlProps" type="React.HTMLAttributes<T>" optional=false %}
|
|
27
27
|
{% /parameter %}
|
|
28
28
|
|
|
29
|
-
{% parameter name="
|
|
29
|
+
{% parameter name="input.disableSpeakingIndicator" type="boolean" optional=true %}
|
|
30
30
|
{% /parameter %}
|
|
31
31
|
|
|
32
|
-
{% parameter name="
|
|
32
|
+
{% parameter name="input.onParticipantClick" type="(event: ParticipantClickEvent) => void" optional=true %}
|
|
33
33
|
{% /parameter %}
|
|
34
34
|
|
|
35
|
-
{% parameter name="
|
|
35
|
+
{% parameter name="input.trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
|
|
36
36
|
The track reference to display.
|
|
37
37
|
|
|
38
38
|
{% /parameter %}
|
|
@@ -25,10 +25,10 @@ import { useStartAudio } from "@livekit/components-react";
|
|
|
25
25
|
|
|
26
26
|
## Properties
|
|
27
27
|
|
|
28
|
-
{% parameter name="
|
|
28
|
+
{% parameter name="input.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
|
|
29
29
|
{% /parameter %}
|
|
30
30
|
|
|
31
|
-
{% parameter name="
|
|
31
|
+
{% parameter name="input.room" type="Room" optional=true %}
|
|
32
32
|
{% /parameter %}
|
|
33
33
|
|
|
34
34
|
## Returns
|
|
@@ -25,10 +25,10 @@ import { useStartVideo } from "@livekit/components-react";
|
|
|
25
25
|
|
|
26
26
|
## Properties
|
|
27
27
|
|
|
28
|
-
{% parameter name="
|
|
28
|
+
{% parameter name="input.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
|
|
29
29
|
{% /parameter %}
|
|
30
30
|
|
|
31
|
-
{% parameter name="
|
|
31
|
+
{% parameter name="input.room" type="Room" optional=true %}
|
|
32
32
|
{% /parameter %}
|
|
33
33
|
|
|
34
34
|
## Returns
|
|
@@ -26,7 +26,7 @@ return <button {...buttonProps}>{enabled ? "disable" : "enable"}</button>;
|
|
|
26
26
|
|
|
27
27
|
## Properties
|
|
28
28
|
|
|
29
|
-
{% parameter name="
|
|
29
|
+
{% parameter name="input.room" type="Room" optional=true %}
|
|
30
30
|
{% /parameter %}
|
|
31
31
|
|
|
32
32
|
## Returns
|