Type Alias: AgentConfig
type AgentConfig = {
scene_id: UUID;
token: string;
mode?: "join" | "start" | "join-or-start" | "join-all" | "manual";
is_transient?: boolean;
session_options?: Record<string, boolean>;
session_selector?: SessionSelector;
watch?: {
interval_seconds?: number;
};
leave_on_condition?: {
after_seconds: number;
agent_roster_id?: UUID;
should_stay?: (params: {
livelink: Livelink;
other_clients: ReadonlyArray<Client>;
}) => boolean | Promise<boolean>;
};
headless_client?: {
updatesPerSecond?: number;
broadcastsPerSecond?: number;
};
onProgress?: (
stage: LivelinkConnectionStage,
info: {
session_id?: UUID;
},
) => void;
};
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:57
Configuration for an agent.
Properties
scene_id
scene_id: UUID;
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:61
The unique identifier of the scene to run.
token
token: string;
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:66
The authentication token.
mode?
optional mode?: "join" | "start" | "join-or-start" | "join-all" | "manual";
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:72
The strategy used to attach to sessions of the scene.
Defaults to "join-or-start".
is_transient?
optional is_transient?: boolean;
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:78
Whether sessions created by the agent are transient. Transient sessions are temporary and
changes are not saved. Only used by the "start" and "join-or-start" modes.
session_options?
optional session_options?: Record<string, boolean>;
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:83
Options for creating the session. Only used by the "start" and "join-or-start" modes.
session_selector?
optional session_selector?: SessionSelector;
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:89
A callback that selects a session from a list of candidate sessions.
Only used by the "join" and "join-or-start" modes.
watch?
optional watch?: {
interval_seconds?: number;
};
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:95
Poll the session list regularly and join sessions that appear.
Only valid with the "join" and "join-all" modes.
| Name | Type | Description |
|---|---|---|
interval_seconds? | number | The polling interval in seconds. Defaults to 10. |
leave_on_condition?
optional leave_on_condition?: {
after_seconds: number;
agent_roster_id?: UUID;
should_stay?: (params: {
livelink: Livelink;
other_clients: ReadonlyArray<Client>;
}) => boolean | Promise<boolean>;
};
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:105
Leave a session when the configured leave condition is met for the given duration.
| Name | Type | Description |
|---|---|---|
after_seconds | number | The number of seconds the condition must persist before leaving the session. |
agent_roster_id? | UUID | The UUID of the agent_roster entity, under which each agent registers a marker entity named after its own client id (see Session.client_id). When set, the default should_stay predicate uses the roster's children to identify which of the other clients are agents. If the entity is not found in the scene, an error is logged and the check falls back to plain other-client presence. |
should_stay()? | (params: { livelink: Livelink; other_clients: ReadonlyArray<Client>; }) => boolean | Promise<boolean> | Determines whether the agent should stay in the session based on the given livelink and the other clients connected. Defaults to stay while a non-agent client is present (see agent_roster_id), or any other client is present when roster is absent. |
headless_client?
optional headless_client?: {
updatesPerSecond?: number;
broadcastsPerSecond?: number;
};
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:134
Options for the headless client update loop started in each session.
| Name | Type |
|---|---|
updatesPerSecond? | number |
broadcastsPerSecond? | number |
onProgress?
optional onProgress?: (stage: LivelinkConnectionStage, info: {
session_id?: UUID;
}) => void;
Defined in: livelink.clients/livelink.agent/sources/Agent.ts:142
Callback for tracking connection progress of each session the agent attaches to.
Parameters
| Parameter | Type |
|---|---|
stage | LivelinkConnectionStage |
info | { session_id?: UUID; } |
info.session_id? | UUID |
Returns
void