@signalhousellc/sdk 1.0.67 → 1.0.68

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalhousellc/sdk",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -19,7 +19,9 @@
19
19
  },
20
20
  "scripts": {
21
21
  "postinstall": "node scripts/install-skills.mjs",
22
- "sync-skills": "node scripts/sync-skills.mjs"
22
+ "sync-skills": "node scripts/sync-skills.mjs",
23
+ "build:types": "tsc -p tsconfig.json",
24
+ "check:types": "tsc -p tsconfig.json --noEmit"
23
25
  },
24
26
  "agents": {
25
27
  "skills": "./skills"
@@ -36,5 +38,10 @@
36
38
  "jssip": {
37
39
  "optional": true
38
40
  }
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^22.20.3",
44
+ "jssip": "^3.13.8",
45
+ "typescript": "^5.9.3"
39
46
  }
40
47
  }
@@ -6,6 +6,19 @@ import axios from "axios";
6
6
  * @property {object} [headers] - Additional headers to include in the request
7
7
  */
8
8
 
9
+ /**
10
+ * @typedef {Object} SignalHouseSDKConfig
11
+ * @property {string} apiKey - The API key for authenticating requests to the SignalHouse API
12
+ * @property {string} baseUrl - The base URL for the SignalHouse API (e.g., "https://api.signalhouse.com")
13
+ * @property {boolean} [enableAdmin=false] - Enable admin-scoped behaviors on domains that support them
14
+ */
15
+
16
+ /**
17
+ * The envelope every domain method resolves to. Non-2xx responses never reject; check `success` first.
18
+ * @template T
19
+ * @typedef {{ success: true, data: T, status: number } | { success: false, error: string|Object, status: number|null }} SdkResponse
20
+ */
21
+
9
22
  // Main SDK Class (SignalHouseSDK.js)
10
23
  import { Auth } from "./domains/Auth.js";
11
24
  import { Billing } from "./domains/Billing.js";
@@ -29,19 +42,15 @@ import { Agents } from "./domains/Agents.js";
29
42
  export class SignalHouseSDK {
30
43
  /**
31
44
  * Initialize the SignalHouseSDK with the required configuration
32
- * @param {Object} config - The configuration object for initializing the SDK
33
- * @param {string} config.apiKey - The API key for authenticating requests to the SignalHouse API
34
- * @param {string} config.baseUrl - The base URL for the SignalHouse API (e.g., "https://api.signalhouse.com")
35
- * @param {boolean} [config.enableAdmin=false] - Enable admin-scoped behaviors on domains that support them.
45
+ * @param {SignalHouseSDKConfig} config - The configuration object for initializing the SDK
36
46
  * @throws {Error} Throws an error if the API key or base URL is missing from the configuration
37
- * @returns {SignalHouseSDK} An instance of the SignalHouseSDK
38
47
  */
39
- constructor(config = {}) {
48
+ constructor(config) {
40
49
  // Validate required config parameters
41
- if (!config.apiKey) {
50
+ if (!config?.apiKey) {
42
51
  throw new Error("API key is required to initialize SignalHouseSDK");
43
52
  }
44
- if (!config.baseUrl) {
53
+ if (!config?.baseUrl) {
45
54
  throw new Error("Base URL is required to initialize SignalHouseSDK");
46
55
  }
47
56
 
@@ -90,19 +99,21 @@ export class SignalHouseSDK {
90
99
  const instance = axios.create({ baseURL: this.baseUrl, headers: isMultipart ? {} : { "Content-Type": "application/json" } });
91
100
 
92
101
  // Add a request interceptor to include the API key in the Authorization header
93
- instance.interceptors.request.use((config) => {
102
+ instance.interceptors.request.use((/** @type {import('axios').InternalAxiosRequestConfig & { token?: string }} */ config) => {
94
103
  const token = config.token || this.apiKey;
95
104
  config.headers.Authorization = `Bearer ${token}`;
96
105
  delete config.token; // Remove token from config to avoid sending it as a header
97
106
  return config;
98
107
  });
99
108
 
100
- // Standardize responses
109
+ // Standardize responses. The fulfilled handler deliberately replaces the AxiosResponse with the
110
+ // SdkResponse envelope, which axios's interceptor typing does not model; the cast keeps that intent visible.
101
111
  instance.interceptors.response.use(
102
112
  // Standard 2xx responses
103
- (response) => {
113
+ /** @type {(response: import('axios').AxiosResponse) => any} */
114
+ ((response) => {
104
115
  return { success: true, data: response.data, status: response.status };
105
- },
116
+ }),
106
117
 
107
118
  // Non-2xx responses
108
119
  (error) => {
@@ -156,7 +167,7 @@ export class SignalHouseSDK {
156
167
  _require(fields) {
157
168
  for (const [name, value] of Object.entries(fields)) {
158
169
  if (value === undefined || value === null || value === "") {
159
- const error = new Error(`Missing required parameter: ${name}`);
170
+ const error = /** @type {Error & { status?: number }} */ (new Error(`Missing required parameter: ${name}`));
160
171
  error.name = "SignalHouseValidationError";
161
172
  error.status = 400; // Match API validation code
162
173
  throw error;
@@ -1,3 +1,9 @@
1
+ /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
+ /**
3
+ * @template T
4
+ * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
+ */
6
+
1
7
  /**
2
8
  * @typedef {Object} CreateAgentProfileData
3
9
  * @property {string} groupId - The parent group id (at least 8 characters, starts with 'G').
@@ -7,10 +13,6 @@
7
13
  * @property {string} [systemPrompt] - Base system prompt composed into every conversation.
8
14
  * @property {string} [greeting] - Opening line the agent leads with.
9
15
  * @property {string} [guardrails] - Freeform guardrail instructions appended to the composed prompt.
10
- * @property {string|null} [voiceId] - ElevenLabs voice id for the voice channel; null until set.
11
- * @property {string} [llmProvider] - LLM backend: "bedrock", "openai", "anthropic", or "groq" (defaults to "bedrock").
12
- * @property {string|null} [llmModel] - Concrete model id for the provider; null = provider default.
13
- * @property {number} [temperature] - Sampling temperature (0-2).
14
16
  */
15
17
 
16
18
  /**
@@ -20,10 +22,33 @@
20
22
  * @property {string} [systemPrompt] - Base system prompt composed into every conversation.
21
23
  * @property {string} [greeting] - Opening line the agent leads with.
22
24
  * @property {string} [guardrails] - Freeform guardrail instructions appended to the composed prompt.
23
- * @property {string|null} [voiceId] - ElevenLabs voice id for the voice channel.
24
- * @property {string} [llmProvider] - LLM backend: "bedrock", "openai", "anthropic", or "groq".
25
+ */
26
+
27
+ /**
28
+ * The per-channel settings for one agent. Model, voice and sampling settings live here rather
29
+ * than on the profile: each channel is served by a different runtime, and the model catalogues
30
+ * do not overlap — so a value that is valid on one channel may be invalid on another.
31
+ * @typedef {Object} AgentChannelSettingData
32
+ * @property {string[]} [allowedTools] - Tools enabled on this channel — built-in keys or custom agentTool ids.
33
+ * @property {boolean} [enabled] - Whether the agent answers on this channel.
34
+ * @property {string} [channelPrompt] - Channel-specific prompt text appended to the agent's system prompt.
35
+ * @property {string|null} [greeting] - Channel-specific greeting override; null = use the agent's greeting.
36
+ * @property {string} [llmProvider] - LLM backend for this channel: "bedrock", "openai", "anthropic", or "groq" (defaults to "bedrock").
25
37
  * @property {string|null} [llmModel] - Concrete model id for the provider; null = provider default.
26
38
  * @property {number} [temperature] - Sampling temperature (0-2).
39
+ * @property {string|null} [voiceId] - Voice identifier for spoken channels; ignored off the voice channel.
40
+ * @property {number|null} [speed] - Speaking rate multiplier (0.7-1.2); null = platform default.
41
+ * @property {number|null} [stability] - Voice consistency (0-1); lower is more expressive and more variable.
42
+ * @property {number|null} [similarityBoost] - How closely synthesis tracks the source voice (0-1).
43
+ * @property {string|null} [speechModel] - Speech synthesis model; separate from `llmModel`, which decides what is said rather than how it is voiced.
44
+ * @property {string|null} [turnEagerness] - How readily the agent decides the caller has finished: "patient", "normal", or "eager".
45
+ * @property {number|null} [turnTimeoutSeconds] - Silence before the agent takes its turn: 1-300, or -1 for no timeout.
46
+ * @property {number|null} [initialWaitSeconds] - Silence before the agent speaks first: 1-300, or -1 for no timeout.
47
+ * @property {number|null} [silenceEndCallSeconds] - Silence before the call is ended outright (10-7200).
48
+ * @property {number|null} [maxCallDurationSeconds] - Hard ceiling on one conversation (60-7200).
49
+ * @property {boolean} [allowGreetingInterruption] - Whether a caller may talk over the greeting.
50
+ * @property {string[]} [keyterms] - Words the transcriber is biased toward — names, jargon, unusual spellings.
51
+ * @property {Object|null} [backgroundSound] - Ambient audio bed as `{ preset, volume }`; null = silence.
27
52
  */
28
53
 
29
54
  export class Agents {
@@ -32,21 +57,37 @@ export class Agents {
32
57
  this.enableAdmin = enableAdmin;
33
58
  }
34
59
 
60
+ /**
61
+ * List the voices an agent can be configured to speak with.
62
+ *
63
+ * The catalog is platform-wide, not per-account, so this takes no scope. `voiceId` is the
64
+ * value to set on a spoken channel's setting.
65
+ * @async
66
+ * @roles api, admin, developer, billing, user
67
+ * @param {Object} [params] - The parameters for the request.
68
+ * @param {RequestOptions} [params.options] - Additional options for the request.
69
+ * @returns {Promise<SdkResponse<any>>} - The available voices, each as `{ voiceId, name, description, previewUrl, gender, accent, age, useCase, language }`.
70
+ */
71
+ async getAgentVoices({ options = {} } = {}) {
72
+ return this.client("/agent/voices", { method: "GET", ...options });
73
+ }
74
+
35
75
  /**
36
76
  * List the agent profiles under a group.
37
77
  * @async
38
78
  * @roles api, admin, developer, billing, user
39
79
  * @param {Object} params - The parameters for listing agent profiles.
40
80
  * @param {string} params.groupId - The group whose profiles to list (required).
81
+ * @param {string} [params.subgroupId] - Narrow to the agents this subgroup can use — its own, plus the group-level agents shared with every subgroup.
41
82
  * @param {number} [params.page] - The page number for pagination.
42
83
  * @param {number} [params.limit] - The number of items per page for pagination.
43
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
84
+ * @param {RequestOptions} [params.options] - Additional options for the request.
44
85
  * @throws {Error} Throws an error if the groupId parameter is missing.
45
- * @returns {Promise<Object>} - The list of agent profiles returned from the server.
86
+ * @returns {Promise<SdkResponse<any>>} - The list of agent profiles returned from the server.
46
87
  */
47
- async getAgentProfiles({ groupId, page, limit, options = {} }) {
88
+ async getAgentProfiles({ groupId, subgroupId, page, limit, options = {} }) {
48
89
  this.client._require({ groupId });
49
- const queryString = this.client._getQueryString({ groupId, page, limit });
90
+ const queryString = this.client._getQueryString({ groupId, subgroupId, page, limit });
50
91
  return this.client(`/agent/profiles${queryString}`, { method: "GET", ...options });
51
92
  }
52
93
 
@@ -56,9 +97,9 @@ export class Agents {
56
97
  * @roles api, admin, developer, billing, user
57
98
  * @param {Object} params - The parameters for getting an agent profile.
58
99
  * @param {string} params.agentProfileId - The id of the agent profile to fetch.
59
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
100
+ * @param {RequestOptions} [params.options] - Additional options for the request.
60
101
  * @throws {Error} Throws an error if the agentProfileId parameter is missing.
61
- * @returns {Promise<Object>} - The agent profile returned from the server.
102
+ * @returns {Promise<SdkResponse<any>>} - The agent profile returned from the server.
62
103
  */
63
104
  async getAgentProfile({ agentProfileId, options = {} }) {
64
105
  this.client._require({ agentProfileId });
@@ -72,9 +113,9 @@ export class Agents {
72
113
  * @roles api, admin, developer
73
114
  * @param {Object} params - The parameters for creating an agent profile (see CreateAgentProfileData typedef).
74
115
  * @param {CreateAgentProfileData} params.profileData - The data for the agent profile to create, including required fields groupId and name.
75
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
116
+ * @param {RequestOptions} [params.options] - Additional options for the request.
76
117
  * @throws {Error} Throws an error if the profileData parameter is missing.
77
- * @returns {Promise<Object>} - The created agent profile returned from the server.
118
+ * @returns {Promise<SdkResponse<any>>} - The created agent profile returned from the server.
78
119
  */
79
120
  async createAgentProfile({ profileData, options = {} }) {
80
121
  this.client._require({ profileData });
@@ -88,9 +129,9 @@ export class Agents {
88
129
  * @param {Object} params - The parameters for updating an agent profile (see UpdateAgentProfileData typedef).
89
130
  * @param {string} params.id - The id of the agent profile to update.
90
131
  * @param {UpdateAgentProfileData} params.updateData - The data for the agent profile to update.
91
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
132
+ * @param {RequestOptions} [params.options] - Additional options for the request.
92
133
  * @throws {Error} Throws an error if the id or updateData parameter is missing.
93
- * @returns {Promise<Object>} - The updated agent profile returned from the server.
134
+ * @returns {Promise<SdkResponse<any>>} - The updated agent profile returned from the server.
94
135
  */
95
136
  async updateAgentProfile({ id, updateData, options = {} }) {
96
137
  this.client._require({ id, updateData });
@@ -104,9 +145,9 @@ export class Agents {
104
145
  * @roles api, admin, developer
105
146
  * @param {Object} params - The parameters for deleting an agent profile.
106
147
  * @param {string} params.id - The id of the agent profile to delete.
107
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
148
+ * @param {RequestOptions} [params.options] - Additional options for the request.
108
149
  * @throws {Error} Throws an error if the id parameter is missing.
109
- * @returns {Promise<Object>} - The inactivated agent profile returned from the server.
150
+ * @returns {Promise<SdkResponse<any>>} - The inactivated agent profile returned from the server.
110
151
  */
111
152
  async deleteAgentProfile({ id, options = {} }) {
112
153
  this.client._require({ id });
@@ -127,9 +168,9 @@ export class Agents {
127
168
  * @param {string} params.message - The user's message (required).
128
169
  * @param {string} [params.conversationId] - Continue this conversation; omit to start a new one.
129
170
  * @param {string} [params.contactIdentifier] - The far-end identifier (webchat visitor id, sender number).
130
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
171
+ * @param {RequestOptions} [params.options] - Additional options for the request.
131
172
  * @throws {Error} Throws an error if agentProfileId, channel, or message is missing.
132
- * @returns {Promise<Object>} - `{ conversationId, conversationSessionId, reply, toolInvocations, ok }` from the server.
173
+ * @returns {Promise<SdkResponse<any>>} - `{ conversationId, conversationSessionId, reply, toolInvocations, ok }` from the server.
133
174
  */
134
175
  async sendAgentMessage({ agentProfileId, channel, message, conversationId, contactIdentifier, options = {} }) {
135
176
  this.client._require({ agentProfileId, channel, message });
@@ -139,6 +180,114 @@ export class Agents {
139
180
  return this.client(`/agent/messages`, { method: "POST", body, ...options });
140
181
  }
141
182
 
183
+ /**
184
+ * Start a conversation without sending a message.
185
+ *
186
+ * The counterpart to `sendAgentMessage` for callers that run the model themselves —
187
+ * a voice runtime, or your own LLM. Those record what was said; `sendAgentMessage`
188
+ * decides it. Both write the same conversation records.
189
+ * @async
190
+ * @roles api, admin, developer, billing, user
191
+ * @param {Object} params - The parameters for starting a conversation.
192
+ * @param {string} params.agentProfileId - The agent this conversation belongs to (required).
193
+ * @param {string} params.channel - The channel: "webchat", "sms", or "voice" (required).
194
+ * @param {string} [params.contactIdentifier] - The far-end identifier (visitor id, caller number).
195
+ * @param {string} [params.callId] - Telephony call id, for the voice channel.
196
+ * @param {Object} [params.metadata] - Arbitrary metadata stored with the conversation.
197
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
198
+ * @throws {Error} Throws an error if agentProfileId or channel is missing.
199
+ * @returns {Promise<Object>} - The created conversation, including `conversationId` and `conversationSessionId`.
200
+ */
201
+ async startConversation({ agentProfileId, channel, contactIdentifier, callId, metadata, options = {} }) {
202
+ this.client._require({ agentProfileId, channel });
203
+ const body = { agentProfileId, channel };
204
+ if (contactIdentifier !== undefined && contactIdentifier !== null) body.contactIdentifier = contactIdentifier;
205
+ if (callId !== undefined && callId !== null) body.callId = callId;
206
+ if (metadata !== undefined && metadata !== null) body.metadata = metadata;
207
+ return this.client(`/agent/conversations`, { method: "POST", body, ...options });
208
+ }
209
+
210
+ /**
211
+ * Read one conversation with a page of its messages, in order.
212
+ *
213
+ * Paged rather than whole: a transcript has no natural ceiling. Omitting `limit` gives 100
214
+ * messages, not all of them.
215
+ * @async
216
+ * @roles api, admin, developer, billing, user
217
+ * @param {Object} params - The parameters for reading a conversation.
218
+ * @param {string} params.conversationId - The conversation to read (required).
219
+ * @param {number} [params.page] - Page number; defaults to 1.
220
+ * @param {number} [params.limit] - Messages per page; defaults to 100, capped at 500.
221
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
222
+ * @throws {Error} Throws an error if the conversationId parameter is missing.
223
+ * @returns {Promise<Object>} - A one-element array with the conversation and its `messages`.
224
+ */
225
+ async getConversation({ conversationId, page, limit, options = {} }) {
226
+ this.client._require({ conversationId });
227
+ const safeId = encodeURIComponent(conversationId);
228
+ const queryString = this.client._getQueryString({ page, limit });
229
+ return this.client(`/agent/conversations/${safeId}${queryString}`, { method: "GET", ...options });
230
+ }
231
+
232
+ /**
233
+ * Append one message to a conversation.
234
+ *
235
+ * Records a turn rather than generating one, so `role` is explicit — an assistant turn
236
+ * your own runtime produced is the normal case here. `content` is optional so a
237
+ * tool-only turn needs no prose.
238
+ * @async
239
+ * @roles api, admin, developer, billing, user
240
+ * @param {Object} params - The parameters for appending a message.
241
+ * @param {string} params.conversationId - The conversation to append to (required).
242
+ * @param {string} params.role - "user", "assistant", "system", or "tool" (required).
243
+ * @param {string} [params.content] - What was said.
244
+ * @param {Array<Object>} [params.toolCalls] - Tools invoked on this turn.
245
+ * @param {Array<Object>} [params.toolResults] - Their results.
246
+ * @param {number} [params.ttfbMs] - Time to first byte/audio, in milliseconds.
247
+ * @param {number} [params.latencyMs] - Total turn latency, in milliseconds.
248
+ * @param {boolean} [params.bargeInOccurred] - Whether the far end talked over this turn.
249
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
250
+ * @throws {Error} Throws an error if conversationId or role is missing.
251
+ * @returns {Promise<Object>} - The persisted message.
252
+ */
253
+ async appendConversationMessage({ conversationId, role, content, toolCalls, toolResults, ttfbMs, latencyMs, bargeInOccurred, options = {} }) {
254
+ this.client._require({ conversationId, role });
255
+ const safeId = encodeURIComponent(conversationId);
256
+ const body = { role };
257
+ if (content !== undefined && content !== null) body.content = content;
258
+ if (toolCalls !== undefined && toolCalls !== null) body.toolCalls = toolCalls;
259
+ if (toolResults !== undefined && toolResults !== null) body.toolResults = toolResults;
260
+ if (ttfbMs !== undefined && ttfbMs !== null) body.ttfbMs = ttfbMs;
261
+ if (latencyMs !== undefined && latencyMs !== null) body.latencyMs = latencyMs;
262
+ if (bargeInOccurred !== undefined && bargeInOccurred !== null) body.bargeInOccurred = bargeInOccurred;
263
+ return this.client(`/agent/conversations/${safeId}/messages`, { method: "POST", body, ...options });
264
+ }
265
+
266
+ /**
267
+ * End a conversation, closing its open session.
268
+ *
269
+ * `status` records HOW it ended and cannot be recovered afterwards, so pass the one that
270
+ * actually happened. Ending an already-ended conversation is a no-op, so a retry after a
271
+ * dropped connection cannot overwrite it.
272
+ * @async
273
+ * @roles api, admin, developer, billing, user
274
+ * @param {Object} params - The parameters for ending a conversation.
275
+ * @param {string} params.conversationId - The conversation to end (required).
276
+ * @param {string} [params.status] - "completed", "escalated", or "abandoned" (defaults to "completed").
277
+ * @param {Object} [params.metadata] - Metadata merged onto the conversation.
278
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
279
+ * @throws {Error} Throws an error if the conversationId parameter is missing.
280
+ * @returns {Promise<Object>} - The ended conversation.
281
+ */
282
+ async endConversation({ conversationId, status, metadata, options = {} }) {
283
+ this.client._require({ conversationId });
284
+ const safeId = encodeURIComponent(conversationId);
285
+ const body = {};
286
+ if (status !== undefined && status !== null) body.status = status;
287
+ if (metadata !== undefined && metadata !== null) body.metadata = metadata;
288
+ return this.client(`/agent/conversations/${safeId}`, { method: "PUT", body, ...options });
289
+ }
290
+
142
291
  /**
143
292
  * List an agent's per-channel settings (the tools enabled per channel, whether the
144
293
  * channel is on, and any channel-specific prompt/greeting).
@@ -146,9 +295,9 @@ export class Agents {
146
295
  * @roles api, admin, developer, billing, user
147
296
  * @param {Object} params - The parameters for listing channel settings.
148
297
  * @param {string} params.agentProfileId - The agent whose channel settings to list.
149
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
298
+ * @param {RequestOptions} [params.options] - Additional options for the request.
150
299
  * @throws {Error} Throws an error if the agentProfileId parameter is missing.
151
- * @returns {Promise<Object>} - The agent's channel settings returned from the server.
300
+ * @returns {Promise<SdkResponse<any>>} - The agent's channel settings returned from the server.
152
301
  */
153
302
  async getAgentChannelSettings({ agentProfileId, options = {} }) {
154
303
  this.client._require({ agentProfileId });
@@ -163,9 +312,9 @@ export class Agents {
163
312
  * @param {Object} params - The parameters for getting a channel setting.
164
313
  * @param {string} params.agentProfileId - The agent the setting belongs to.
165
314
  * @param {string} params.channel - The channel: "webchat", "sms", or "voice".
166
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
315
+ * @param {RequestOptions} [params.options] - Additional options for the request.
167
316
  * @throws {Error} Throws an error if agentProfileId or channel is missing.
168
- * @returns {Promise<Object>} - The channel setting returned from the server.
317
+ * @returns {Promise<SdkResponse<any>>} - The channel setting returned from the server.
169
318
  */
170
319
  async getAgentChannelSetting({ agentProfileId, channel, options = {} }) {
171
320
  this.client._require({ agentProfileId, channel });
@@ -182,10 +331,10 @@ export class Agents {
182
331
  * @param {Object} params - The parameters for the upsert.
183
332
  * @param {string} params.agentProfileId - The agent the setting belongs to.
184
333
  * @param {string} params.channel - The channel: "webchat", "sms", or "voice".
185
- * @param {Object} [params.settingData] - The fields to set: allowedTools (string[]), enabled (boolean), channelPrompt (string), greeting (string|null).
186
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
334
+ * @param {AgentChannelSettingData} [params.settingData] - The fields to set.
335
+ * @param {RequestOptions} [params.options] - Additional options for the request.
187
336
  * @throws {Error} Throws an error if agentProfileId or channel is missing.
188
- * @returns {Promise<Object>} - The created or updated channel setting returned from the server.
337
+ * @returns {Promise<SdkResponse<any>>} - The created or updated channel setting returned from the server.
189
338
  */
190
339
  async upsertAgentChannelSetting({ agentProfileId, channel, settingData = {}, options = {} }) {
191
340
  this.client._require({ agentProfileId, channel });
@@ -201,9 +350,9 @@ export class Agents {
201
350
  * @param {Object} params - The parameters for the delete.
202
351
  * @param {string} params.agentProfileId - The agent the setting belongs to.
203
352
  * @param {string} params.channel - The channel: "webchat", "sms", or "voice".
204
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
353
+ * @param {RequestOptions} [params.options] - Additional options for the request.
205
354
  * @throws {Error} Throws an error if agentProfileId or channel is missing.
206
- * @returns {Promise<Object>} - The delete confirmation returned from the server.
355
+ * @returns {Promise<SdkResponse<any>>} - The delete confirmation returned from the server.
207
356
  */
208
357
  async deleteAgentChannelSetting({ agentProfileId, channel, options = {} }) {
209
358
  this.client._require({ agentProfileId, channel });
@@ -221,9 +370,9 @@ export class Agents {
221
370
  * @param {Object} params - The parameters for reading tenant settings.
222
371
  * @param {string} params.groupId - The group (required).
223
372
  * @param {string} [params.subgroupId] - The subgroup; omit for the group-level settings.
224
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
373
+ * @param {RequestOptions} [params.options] - Additional options for the request.
225
374
  * @throws {Error} Throws an error if the groupId parameter is missing.
226
- * @returns {Promise<Object>} - The tenant settings returned from the server.
375
+ * @returns {Promise<SdkResponse<any>>} - The tenant settings returned from the server.
227
376
  */
228
377
  async getTenantAiSettings({ groupId, subgroupId, options = {} }) {
229
378
  this.client._require({ groupId });
@@ -240,9 +389,9 @@ export class Agents {
240
389
  * @param {string} params.groupId - The group (required).
241
390
  * @param {string} [params.subgroupId] - The subgroup; omit for the group-level settings.
242
391
  * @param {Object} [params.settingsData] - Fields to set: brandName (string), tone (string), timezone (IANA string), businessHours (array of {day, closed, open, close}), afterHoursMessage (string).
243
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
392
+ * @param {RequestOptions} [params.options] - Additional options for the request.
244
393
  * @throws {Error} Throws an error if the groupId parameter is missing.
245
- * @returns {Promise<Object>} - The created or updated tenant settings returned from the server.
394
+ * @returns {Promise<SdkResponse<any>>} - The created or updated tenant settings returned from the server.
246
395
  */
247
396
  async upsertTenantAiSettings({ groupId, subgroupId, settingsData = {}, options = {} }) {
248
397
  this.client._require({ groupId });
@@ -257,9 +406,9 @@ export class Agents {
257
406
  * @param {Object} params - The parameters for the delete.
258
407
  * @param {string} params.groupId - The group (required).
259
408
  * @param {string} [params.subgroupId] - The subgroup; omit for the group-level settings.
260
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
409
+ * @param {RequestOptions} [params.options] - Additional options for the request.
261
410
  * @throws {Error} Throws an error if the groupId parameter is missing.
262
- * @returns {Promise<Object>} - The delete confirmation returned from the server.
411
+ * @returns {Promise<SdkResponse<any>>} - The delete confirmation returned from the server.
263
412
  */
264
413
  async deleteTenantAiSettings({ groupId, subgroupId, options = {} }) {
265
414
  this.client._require({ groupId });
@@ -278,9 +427,9 @@ export class Agents {
278
427
  * @param {string} [params.agentProfileId] - Narrow to one agent.
279
428
  * @param {number} [params.page] - Page number (1-based) for pagination.
280
429
  * @param {number} [params.limit] - Items per page (max 100; server default 25).
281
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
430
+ * @param {RequestOptions} [params.options] - Additional options for the request.
282
431
  * @throws {Error} Throws an error if the groupId parameter is missing.
283
- * @returns {Promise<Object>} - The knowledge items returned from the server.
432
+ * @returns {Promise<SdkResponse<any>>} - The knowledge items returned from the server.
284
433
  */
285
434
  async getKnowledgeItems({ groupId, subgroupId, agentProfileId, page, limit, options = {} }) {
286
435
  this.client._require({ groupId });
@@ -294,9 +443,9 @@ export class Agents {
294
443
  * @roles api, admin, developer, billing, user
295
444
  * @param {Object} params - The parameters for getting a knowledge item.
296
445
  * @param {string} params.knowledgeItemId - The id of the knowledge item to fetch.
297
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
446
+ * @param {RequestOptions} [params.options] - Additional options for the request.
298
447
  * @throws {Error} Throws an error if the knowledgeItemId parameter is missing.
299
- * @returns {Promise<Object>} - The knowledge item returned from the server.
448
+ * @returns {Promise<SdkResponse<any>>} - The knowledge item returned from the server.
300
449
  */
301
450
  async getKnowledgeItem({ knowledgeItemId, options = {} }) {
302
451
  this.client._require({ knowledgeItemId });
@@ -314,9 +463,9 @@ export class Agents {
314
463
  * Optional: subgroupId (starts with 'S', nullable), agentProfileId
315
464
  * (nullable = shared across the tenant's agents), title, source
316
465
  * ("manual" | "url" | "document" | "import"), enabled (boolean), metadata (object|null).
317
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
466
+ * @param {RequestOptions} [params.options] - Additional options for the request.
318
467
  * @throws {Error} Throws an error if the itemData parameter is missing.
319
- * @returns {Promise<Object>} - The created knowledge item returned from the server.
468
+ * @returns {Promise<SdkResponse<any>>} - The created knowledge item returned from the server.
320
469
  */
321
470
  async createKnowledgeItem({ itemData, options = {} }) {
322
471
  this.client._require({ itemData });
@@ -331,9 +480,9 @@ export class Agents {
331
480
  * @param {Object} params - The parameters for updating a knowledge item.
332
481
  * @param {string} params.id - The id of the knowledge item to update.
333
482
  * @param {Object} params.updateData - The fields to update: title, text, source, enabled, metadata.
334
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
483
+ * @param {RequestOptions} [params.options] - Additional options for the request.
335
484
  * @throws {Error} Throws an error if the id or updateData parameter is missing.
336
- * @returns {Promise<Object>} - The updated knowledge item returned from the server.
485
+ * @returns {Promise<SdkResponse<any>>} - The updated knowledge item returned from the server.
337
486
  */
338
487
  async updateKnowledgeItem({ id, updateData, options = {} }) {
339
488
  this.client._require({ id, updateData });
@@ -347,9 +496,9 @@ export class Agents {
347
496
  * @roles api, admin, developer
348
497
  * @param {Object} params - The parameters for deleting a knowledge item.
349
498
  * @param {string} params.id - The id of the knowledge item to delete.
350
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
499
+ * @param {RequestOptions} [params.options] - Additional options for the request.
351
500
  * @throws {Error} Throws an error if the id parameter is missing.
352
- * @returns {Promise<Object>} - The delete confirmation returned from the server.
501
+ * @returns {Promise<SdkResponse<any>>} - The delete confirmation returned from the server.
353
502
  */
354
503
  async deleteKnowledgeItem({ id, options = {} }) {
355
504
  this.client._require({ id });
@@ -369,9 +518,9 @@ export class Agents {
369
518
  * @param {string} [params.type] - Narrow to a tool type: "builtin", "webhook", or "mcp".
370
519
  * @param {number} [params.page] - Page number (1-based) for pagination.
371
520
  * @param {number} [params.limit] - Items per page (max 100; server default 25).
372
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
521
+ * @param {RequestOptions} [params.options] - Additional options for the request.
373
522
  * @throws {Error} Throws an error if the groupId parameter is missing.
374
- * @returns {Promise<Object>} - The tools returned from the server (secrets redacted).
523
+ * @returns {Promise<SdkResponse<any>>} - The tools returned from the server (secrets redacted).
375
524
  */
376
525
  async getAgentTools({ groupId, subgroupId, agentProfileId, type, page, limit, options = {} }) {
377
526
  this.client._require({ groupId });
@@ -385,9 +534,9 @@ export class Agents {
385
534
  * @roles api, admin, developer, billing, user
386
535
  * @param {Object} params - The parameters for getting a tool.
387
536
  * @param {string} params.agentToolId - The id of the tool to fetch.
388
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
537
+ * @param {RequestOptions} [params.options] - Additional options for the request.
389
538
  * @throws {Error} Throws an error if the agentToolId parameter is missing.
390
- * @returns {Promise<Object>} - The tool returned from the server (secrets redacted).
539
+ * @returns {Promise<SdkResponse<any>>} - The tool returned from the server (secrets redacted).
391
540
  */
392
541
  async getAgentTool({ agentToolId, options = {} }) {
393
542
  this.client._require({ agentToolId });
@@ -411,9 +560,9 @@ export class Agents {
411
560
  * call (reserved/framing and `x-signalhouse-*` names are rejected); `signingSecret` makes us
412
561
  * send `X-SignalHouse-Signature: sha256=HMAC-SHA256(`${X-SignalHouse-Timestamp}.${rawBody}`)`
413
562
  * so you can verify the call and reject replays. Stored, never returned.
414
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
563
+ * @param {RequestOptions} [params.options] - Additional options for the request.
415
564
  * @throws {Error} Throws an error if the toolData parameter is missing.
416
- * @returns {Promise<Object>} - The created tool returned from the server (secrets redacted).
565
+ * @returns {Promise<SdkResponse<any>>} - The created tool returned from the server (secrets redacted).
417
566
  */
418
567
  async createAgentTool({ toolData, options = {} }) {
419
568
  this.client._require({ toolData });
@@ -428,9 +577,9 @@ export class Agents {
428
577
  * @param {Object} params - The parameters for updating a tool.
429
578
  * @param {string} params.id - The id of the tool to update.
430
579
  * @param {Object} params.updateData - The fields to update: name, description, type, builtinKey, parametersSchema, config, webhookUrl, webhookAuth, mcpServerUrl, channels, enabled.
431
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
580
+ * @param {RequestOptions} [params.options] - Additional options for the request.
432
581
  * @throws {Error} Throws an error if the id or updateData parameter is missing.
433
- * @returns {Promise<Object>} - The updated tool returned from the server (secrets redacted).
582
+ * @returns {Promise<SdkResponse<any>>} - The updated tool returned from the server (secrets redacted).
434
583
  */
435
584
  async updateAgentTool({ id, updateData, options = {} }) {
436
585
  this.client._require({ id, updateData });
@@ -444,9 +593,9 @@ export class Agents {
444
593
  * @roles api, admin, developer
445
594
  * @param {Object} params - The parameters for deleting a tool.
446
595
  * @param {string} params.id - The id of the tool to delete.
447
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
596
+ * @param {RequestOptions} [params.options] - Additional options for the request.
448
597
  * @throws {Error} Throws an error if the id parameter is missing.
449
- * @returns {Promise<Object>} - The delete confirmation returned from the server.
598
+ * @returns {Promise<SdkResponse<any>>} - The delete confirmation returned from the server.
450
599
  */
451
600
  async deleteAgentTool({ id, options = {} }) {
452
601
  this.client._require({ id });