@touchcastllc/napster-companion-api-dev 2.1.0-alpha.13 → 2.1.0-alpha.15
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/lib/constants/events.d.ts +3 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.standalone.js +1 -1
- package/lib/types/index.d.ts +53 -4
- package/package.json +1 -1
package/lib/types/index.d.ts
CHANGED
|
@@ -68,16 +68,41 @@ export type SendMessageCommand = {
|
|
|
68
68
|
export type CancelCommand = {
|
|
69
69
|
type: DataChannelMessageType.CANCEL;
|
|
70
70
|
};
|
|
71
|
+
/** A per-user MCP server's access token, sent in `set_settings.mcp`. */
|
|
72
|
+
export interface McpAuthorization {
|
|
73
|
+
mcp_server_id: string;
|
|
74
|
+
token: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Every field is optional: send only what changes, omitted settings keep
|
|
78
|
+
* their current values. There is no `functions` field: the server never read
|
|
79
|
+
* it in `set_settings` (CA-1396). Tools go in `inline_functions`.
|
|
80
|
+
*/
|
|
71
81
|
export type SetSettingsCommand = {
|
|
72
82
|
type: DataChannelMessageType.SET_SETTINGS;
|
|
73
83
|
data: {
|
|
84
|
+
/** Replaces the agent's system instructions (not appended to them). */
|
|
85
|
+
instructions?: string;
|
|
86
|
+
/** Response temperature, 0–1. */
|
|
87
|
+
temperature?: number;
|
|
88
|
+
/** Voice activity detection. */
|
|
89
|
+
turn_detection?: {
|
|
90
|
+
/** Sensitivity threshold for detecting speech. */
|
|
91
|
+
threshold?: number;
|
|
92
|
+
/** Milliseconds of audio kept before detected speech. */
|
|
93
|
+
prefix_padding_ms?: number;
|
|
94
|
+
/** Milliseconds of silence that end the user's turn. */
|
|
95
|
+
silence_duration_ms?: number;
|
|
96
|
+
};
|
|
74
97
|
/** Session/connection modality (e.g. `"video"` for the avatar connection). */
|
|
75
98
|
modality?: string;
|
|
76
99
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
100
|
+
* Replaces the tokens for per-user MCP servers. The list replaces all
|
|
101
|
+
* tokens, so include every server that needs one.
|
|
79
102
|
*/
|
|
80
|
-
|
|
103
|
+
mcp?: {
|
|
104
|
+
authorizations: McpAuthorization[];
|
|
105
|
+
};
|
|
81
106
|
/**
|
|
82
107
|
* Full function definitions provided inline at runtime. Used to register
|
|
83
108
|
* tools MID-SESSION — e.g. the WebMCP bridge pushes the page's live
|
|
@@ -113,7 +138,31 @@ export type FunctionCallOutputCommand = {
|
|
|
113
138
|
export type ResetInactivityTimeoutCommand = {
|
|
114
139
|
type: DataChannelMessageType.RESET_INACTIVITY_TIMEOUT;
|
|
115
140
|
};
|
|
116
|
-
|
|
141
|
+
/** Puppeteer mode: the agent speaks `text` exactly as written. */
|
|
142
|
+
export type TalkCommand = {
|
|
143
|
+
type: DataChannelMessageType.TALK;
|
|
144
|
+
data: {
|
|
145
|
+
/** Your ID for the line; it comes back as `talk_id` on `talk_state_changed`. */
|
|
146
|
+
talkId: string | number;
|
|
147
|
+
/** The text for the avatar to speak. */
|
|
148
|
+
text: string;
|
|
149
|
+
/** Speak the text sentence by sentence. Defaults to `true`. */
|
|
150
|
+
split?: boolean;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
/** Answers a pending `mcp_approval_request`. */
|
|
154
|
+
export type SendMcpApprovalCommand = {
|
|
155
|
+
type: DataChannelMessageType.SEND_MCP_APPROVAL;
|
|
156
|
+
data: {
|
|
157
|
+
/** The `item_id` from the `mcp_approval_request` event. */
|
|
158
|
+
approval_request_id: string;
|
|
159
|
+
/** `true` runs the tool call; `false` cancels it. */
|
|
160
|
+
approve: boolean;
|
|
161
|
+
/** Free text explaining the decision, passed upstream with it. */
|
|
162
|
+
reason?: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
export type DataChannelCommand = SendMessageCommand | CancelCommand | SetSettingsCommand | StartVideoCommand | StopVideoCommand | FunctionCallOutputCommand | ResetInactivityTimeoutCommand | TalkCommand | SendMcpApprovalCommand;
|
|
117
166
|
export declare const maxInactiveTimeoutDuration = 180000;
|
|
118
167
|
export declare const defaultCountdownDuration = 30;
|
|
119
168
|
/**
|