@talqing/sdk 0.4.0 → 0.4.2

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { client } from './client.gen.js';
4
4
  import { buildClientParams, type Client, type ClientMeta, type Options as Options2, type RequestResult, type ServerSentEventsResult, type TDataShape } from './client/index.js';
5
- import type { AddRecipientsRequest, AddVoiceRequest, AgentsCreateErrors, AgentsCreateResults, AgentsDeleteErrors, AgentsDeleteResults, AgentsGetErrors, AgentsGetResults, AgentsListErrors, AgentsListResults, AgentsPublishErrors, AgentsPublishResults, AgentsUpdateErrors, AgentsUpdateResults, AgentsValidateErrors, AgentsValidateResults, AgentsVersionsGetErrors, AgentsVersionsGetResults, AgentsVersionsRollbackErrors, AgentsVersionsRollbackResults, AssignPhoneNumberRequest, BackfillAnalysisRequest, BillingCreditsCheckoutErrors, BillingCreditsCheckoutResults, BillingCreditsGetErrors, BillingCreditsGetResults, BillingCreditsLedgerErrors, BillingCreditsLedgerResults, BuildKBRequest, CallsAnalysisBackfillErrors, CallsAnalysisBackfillResults, CallsAnalysisPreviewErrors, CallsAnalysisPreviewResults, CallsBatchesCancelErrors, CallsBatchesCancelResults, CallsBatchesCreateErrors, CallsBatchesCreateResults, CallsBatchesGetErrors, CallsBatchesGetResults, CallsBatchesListErrors, CallsBatchesListResults, CallsBatchesPauseErrors, CallsBatchesPauseResults, CallsBatchesRecipientsAddErrors, CallsBatchesRecipientsAddResults, CallsBatchesRecipientsListErrors, CallsBatchesRecipientsListResults, CallsBatchesResumeErrors, CallsBatchesResumeResults, CallsBatchesUpdateErrors, CallsBatchesUpdateResults, CallsDeleteErrors, CallsDeleteResults, CallsGetErrors, CallsGetResults, CallsListErrors, CallsListResults, CallsOutboundErrors, CallsOutboundResults, CallsRecordingDeleteErrors, CallsRecordingDeleteResults, CallsRecordingGetErrors, CallsRecordingGetResults, CallsScreenRecordingGetErrors, CallsScreenRecordingGetResults, CallsStatsErrors, CallsStatsResults, CallsTokenErrors, CallsTokenResults, CatalogAvatarsListErrors, CatalogAvatarsListResults, CatalogGetErrors, CatalogGetResults, CatalogVoicesElevenlabsAddErrors, CatalogVoicesElevenlabsAddResults, CatalogVoicesElevenlabsSettingsErrors, CatalogVoicesElevenlabsSettingsResults, CatalogVoicesListErrors, CatalogVoicesListResults, ConversationsCreateErrors, ConversationsCreateResults, ConversationsEventsErrors, ConversationsEventsResult, ConversationsEventsResults, ConversationsGetErrors, ConversationsGetResults, ConversationsItemsListErrors, ConversationsItemsListResults, ConversationsListErrors, ConversationsListResults, ConversationsMessagesCreateErrors, ConversationsMessagesCreateResults, ConversationsSessionsListErrors, ConversationsSessionsListResults, ConversationsSnapshotErrors, ConversationsSnapshotResults, ConversationsUpdateErrors, ConversationsUpdateResults, CopilotAgentsSendErrors, CopilotAgentsSendResults, CopilotAgentsStreamErrors, CopilotAgentsStreamResult, CopilotAgentsStreamResults, CopilotKnowledgeSendErrors, CopilotKnowledgeSendResults, CopilotKnowledgeStreamErrors, CopilotKnowledgeStreamResult, CopilotKnowledgeStreamResults, CopilotTasksSendErrors, CopilotTasksSendResults, CopilotTasksStreamErrors, CopilotTasksStreamResult, CopilotTasksStreamResults, CopilotToolsSendErrors, CopilotToolsSendResults, CopilotToolsStreamErrors, CopilotToolsStreamResult, CopilotToolsStreamResults, CreateAgentRequest, CreateCallBatchRequest, CreateEmailBatchRequest, CreateIntegrationRequest, CreateIntegrationTriggerRequest, CreateKBRequest, CreateSecretRequest, CreateTaskRequest, CreateTelephonyAccountRequest, CreateTextConversationRequest, CreateToolRequest, CreateWebhookRequest, CreditCheckoutRequest, EmailBatchesCancelErrors, EmailBatchesCancelResults, EmailBatchesCreateErrors, EmailBatchesCreateResults, EmailBatchesGetErrors, EmailBatchesGetResults, EmailBatchesListErrors, EmailBatchesListResults, EmailBatchesPauseErrors, EmailBatchesPauseResults, EmailBatchesRecipientsListErrors, EmailBatchesRecipientsListResults, EmailBatchesRecipientsRestoreErrors, EmailBatchesRecipientsRestoreResults, EmailBatchesRecipientsRetryErrors, EmailBatchesRecipientsRetryResults, EmailBatchesRecipientsSendErrors, EmailBatchesRecipientsSendResults, EmailBatchesRecipientsSkipErrors, EmailBatchesRecipientsSkipResults, EmailBatchesRecipientsUpdateErrors, EmailBatchesRecipientsUpdateResults, EmailBatchesResumeErrors, EmailBatchesResumeResults, EmailBatchesUpdateErrors, EmailBatchesUpdateResults, EmailSendersListErrors, EmailSendersListResults, HealthErrors, HealthResults, ImportPhoneNumbersRequest, IntegrationsCatalogErrors, IntegrationsCatalogResults, IntegrationsCreateErrors, IntegrationsCreateResults, IntegrationsDeleteErrors, IntegrationsDeleteResults, IntegrationsGetErrors, IntegrationsGetResults, IntegrationsListErrors, IntegrationsListResults, IntegrationsMcpToolsListErrors, IntegrationsMcpToolsListResults, IntegrationsTriggersCreateErrors, IntegrationsTriggersCreateResults, IntegrationsTriggersDeleteErrors, IntegrationsTriggersDeleteResults, IntegrationsTriggersListErrors, IntegrationsTriggersListResults, IntegrationsTriggersUpdateErrors, IntegrationsTriggersUpdateResults, IntegrationsUpdateErrors, IntegrationsUpdateResults, KnowledgeBuildErrors, KnowledgeBuildResults, KnowledgeCreateErrors, KnowledgeCreateResults, KnowledgeDeleteErrors, KnowledgeDeleteResults, KnowledgeEventsErrors, KnowledgeEventsResult, KnowledgeEventsResults, KnowledgeGetErrors, KnowledgeGetResults, KnowledgeListErrors, KnowledgeListResults, KnowledgeNodesDeleteErrors, KnowledgeNodesDeleteResults, KnowledgeNodesGetErrors, KnowledgeNodesGetResults, KnowledgeNodesUpdateErrors, KnowledgeNodesUpdateResults, KnowledgePagesListErrors, KnowledgePagesListResults, KnowledgePromptErrors, KnowledgePromptResults, KnowledgeRegenerateTocErrors, KnowledgeRegenerateTocResults, ObservabilityGetErrors, ObservabilityGetResults, OutboundCallRequest, PatchCallBatchRequest, PatchConversationRequest, PatchEmailBatchRequest, PatchEmailRecipientRequest, PatchIntegrationRequest, PatchIntegrationTriggerRequest, PatchNodeRequest, PatchPhoneNumberRequest, PatchTaskRequest, PatchTelephonyAccountRequest, PatchToolRequest, PatchWebhookRequest, PreviewAnalysisRequest, ProviderKeysDeleteErrors, ProviderKeysDeleteResults, ProviderKeysListErrors, ProviderKeysListResults, ProviderKeysSetErrors, ProviderKeysSetResults, PublishToolRequest, RunTaskRequest, RunToolRequest, SchemasFunctionsGetErrors, SchemasFunctionsGetResults, SchemasGetErrors, SchemasGetResults, SecretsCreateErrors, SecretsCreateResults, SecretsDeleteErrors, SecretsDeleteResults, SecretsListErrors, SecretsListResults, SelectRecipientsRequest, SendEmailBatchRequest, SendMessageRequest, SetProviderKeyRequest, TasksCreateErrors, TasksCreateResults, TasksDeleteErrors, TasksDeleteResults, TasksGetErrors, TasksGetResults, TasksListErrors, TasksListResults, TasksRunsCreateErrors, TasksRunsCreateResults, TasksRunsGetErrors, TasksRunsGetResults, TasksRunsListErrors, TasksRunsListResults, TasksUpdateErrors, TasksUpdateResults, TelephonyAccountsCreateErrors, TelephonyAccountsCreateResults, TelephonyAccountsDeleteErrors, TelephonyAccountsDeleteResults, TelephonyAccountsGetErrors, TelephonyAccountsGetResults, TelephonyAccountsListErrors, TelephonyAccountsListResults, TelephonyAccountsProvisionErrors, TelephonyAccountsProvisionResults, TelephonyAccountsRemoteNumbersErrors, TelephonyAccountsRemoteNumbersResults, TelephonyAccountsUpdateErrors, TelephonyAccountsUpdateResults, TelephonyPhoneNumbersAssignErrors, TelephonyPhoneNumbersAssignResults, TelephonyPhoneNumbersGetErrors, TelephonyPhoneNumbersGetResults, TelephonyPhoneNumbersImportErrors, TelephonyPhoneNumbersImportResults, TelephonyPhoneNumbersListErrors, TelephonyPhoneNumbersListResults, TelephonyPhoneNumbersProvisionErrors, TelephonyPhoneNumbersProvisionResults, TelephonyPhoneNumbersUnassignErrors, TelephonyPhoneNumbersUnassignResults, TelephonyPhoneNumbersUpdateErrors, TelephonyPhoneNumbersUpdateResults, TelephonyProvidersListErrors, TelephonyProvidersListResults, TextMessageRequest, TokenRequest, ToolsCreateErrors, ToolsCreateResults, ToolsDeleteErrors, ToolsDeleteResults, ToolsGetErrors, ToolsGetResults, ToolsListErrors, ToolsListResults, ToolsPublishErrors, ToolsPublishResults, ToolsRunErrors, ToolsRunResults, ToolsUpdateErrors, ToolsUpdateResults, ToolsValidateErrors, ToolsValidateResults, ToolsVersionsGetErrors, ToolsVersionsGetResults, ToolsVersionsRollbackErrors, ToolsVersionsRollbackResults, UpdateAgentRequest, WebhooksCreateErrors, WebhooksCreateResults, WebhooksDeleteErrors, WebhooksDeleteResults, WebhooksDeliveriesErrors, WebhooksDeliveriesResults, WebhooksEventTypesErrors, WebhooksEventTypesResults, WebhooksListErrors, WebhooksListResults, WebhooksRotateSecretErrors, WebhooksRotateSecretResults, WebhooksTestErrors, WebhooksTestResults, WebhooksUpdateErrors, WebhooksUpdateResults } from './types.gen.js';
5
+ import type { AddRecipientsRequest, AddVoiceRequest, AgentsCreateErrors, AgentsCreateResults, AgentsDeleteErrors, AgentsDeleteResults, AgentsGetErrors, AgentsGetResults, AgentsListErrors, AgentsListResults, AgentsPublishErrors, AgentsPublishResults, AgentsUpdateErrors, AgentsUpdateResults, AgentsValidateErrors, AgentsValidateResults, AgentsVersionsGetErrors, AgentsVersionsGetResults, AgentsVersionsRollbackErrors, AgentsVersionsRollbackResults, AssignPhoneNumberRequest, BackfillAnalysisRequest, BillingCreditsCheckoutErrors, BillingCreditsCheckoutResults, BillingCreditsGetErrors, BillingCreditsGetResults, BillingCreditsLedgerErrors, BillingCreditsLedgerResults, BuildKBRequest, CallsAnalysisBackfillErrors, CallsAnalysisBackfillResults, CallsAnalysisPreviewErrors, CallsAnalysisPreviewResults, CallsBatchesCancelErrors, CallsBatchesCancelResults, CallsBatchesCreateErrors, CallsBatchesCreateResults, CallsBatchesGetErrors, CallsBatchesGetResults, CallsBatchesListErrors, CallsBatchesListResults, CallsBatchesPauseErrors, CallsBatchesPauseResults, CallsBatchesRecipientsAddErrors, CallsBatchesRecipientsAddResults, CallsBatchesRecipientsListErrors, CallsBatchesRecipientsListResults, CallsBatchesResumeErrors, CallsBatchesResumeResults, CallsBatchesUpdateErrors, CallsBatchesUpdateResults, CallsDeleteErrors, CallsDeleteResults, CallsGetErrors, CallsGetResults, CallsListErrors, CallsListResults, CallsOutboundErrors, CallsOutboundResults, CallsRecordingDeleteErrors, CallsRecordingDeleteResults, CallsRecordingGetErrors, CallsRecordingGetResults, CallsScreenRecordingGetErrors, CallsScreenRecordingGetResults, CallsStatsErrors, CallsStatsResults, CallsTokenErrors, CallsTokenResults, CatalogAvatarsListErrors, CatalogAvatarsListResults, CatalogGetErrors, CatalogGetResults, CatalogModelsSearchErrors, CatalogModelsSearchResults, CatalogVoicesElevenlabsAddErrors, CatalogVoicesElevenlabsAddResults, CatalogVoicesElevenlabsSettingsErrors, CatalogVoicesElevenlabsSettingsResults, CatalogVoicesListErrors, CatalogVoicesListResults, ConversationsCreateErrors, ConversationsCreateResults, ConversationsEventsErrors, ConversationsEventsResult, ConversationsEventsResults, ConversationsGetErrors, ConversationsGetResults, ConversationsItemsListErrors, ConversationsItemsListResults, ConversationsListErrors, ConversationsListResults, ConversationsMessagesCreateErrors, ConversationsMessagesCreateResults, ConversationsSessionsListErrors, ConversationsSessionsListResults, ConversationsSnapshotErrors, ConversationsSnapshotResults, ConversationsUpdateErrors, ConversationsUpdateResults, CopilotAgentsSendErrors, CopilotAgentsSendResults, CopilotAgentsStreamErrors, CopilotAgentsStreamResult, CopilotAgentsStreamResults, CopilotKnowledgeSendErrors, CopilotKnowledgeSendResults, CopilotKnowledgeStreamErrors, CopilotKnowledgeStreamResult, CopilotKnowledgeStreamResults, CopilotTasksSendErrors, CopilotTasksSendResults, CopilotTasksStreamErrors, CopilotTasksStreamResult, CopilotTasksStreamResults, CopilotToolsSendErrors, CopilotToolsSendResults, CopilotToolsStreamErrors, CopilotToolsStreamResult, CopilotToolsStreamResults, CreateAgentRequest, CreateCallBatchRequest, CreateEmailBatchRequest, CreateEmailSendRequest, CreateIntegrationRequest, CreateIntegrationTriggerRequest, CreateKBRequest, CreateSecretRequest, CreateStreamConnectionRequest, CreateTaskRequest, CreateTelephonyAccountRequest, CreateTextConversationRequest, CreateToolRequest, CreateWebhookRequest, CreditCheckoutRequest, EmailBatchesCancelErrors, EmailBatchesCancelResults, EmailBatchesCreateErrors, EmailBatchesCreateResults, EmailBatchesGetErrors, EmailBatchesGetResults, EmailBatchesListErrors, EmailBatchesListResults, EmailBatchesPauseErrors, EmailBatchesPauseResults, EmailBatchesRecipientsListErrors, EmailBatchesRecipientsListResults, EmailBatchesRecipientsRedraftErrors, EmailBatchesRecipientsRedraftResults, EmailBatchesRecipientsRestoreErrors, EmailBatchesRecipientsRestoreResults, EmailBatchesRecipientsSkipErrors, EmailBatchesRecipientsSkipResults, EmailBatchesRecipientsUpdateErrors, EmailBatchesRecipientsUpdateResults, EmailBatchesResumeErrors, EmailBatchesResumeResults, EmailBatchesSendsCancelErrors, EmailBatchesSendsCancelResults, EmailBatchesSendsCreateErrors, EmailBatchesSendsCreateResults, EmailBatchesSendsGetErrors, EmailBatchesSendsGetResults, EmailBatchesSendsListErrors, EmailBatchesSendsListResults, EmailBatchesSendsPauseErrors, EmailBatchesSendsPauseResults, EmailBatchesSendsResumeErrors, EmailBatchesSendsResumeResults, EmailBatchesSendsUpdateErrors, EmailBatchesSendsUpdateResults, EmailBatchesUpdateErrors, EmailBatchesUpdateResults, EmailSendersListErrors, EmailSendersListResults, HealthErrors, HealthResults, ImportPhoneNumbersRequest, IntegrationsCatalogErrors, IntegrationsCatalogResults, IntegrationsCreateErrors, IntegrationsCreateResults, IntegrationsDeleteErrors, IntegrationsDeleteResults, IntegrationsGetErrors, IntegrationsGetResults, IntegrationsListErrors, IntegrationsListResults, IntegrationsMcpToolsListErrors, IntegrationsMcpToolsListResults, IntegrationsTriggersCreateErrors, IntegrationsTriggersCreateResults, IntegrationsTriggersDeleteErrors, IntegrationsTriggersDeleteResults, IntegrationsTriggersListErrors, IntegrationsTriggersListResults, IntegrationsTriggersUpdateErrors, IntegrationsTriggersUpdateResults, IntegrationsUpdateErrors, IntegrationsUpdateResults, KnowledgeBuildErrors, KnowledgeBuildResults, KnowledgeCreateErrors, KnowledgeCreateResults, KnowledgeDeleteErrors, KnowledgeDeleteResults, KnowledgeEventsErrors, KnowledgeEventsResult, KnowledgeEventsResults, KnowledgeGetErrors, KnowledgeGetResults, KnowledgeListErrors, KnowledgeListResults, KnowledgeNodesDeleteErrors, KnowledgeNodesDeleteResults, KnowledgeNodesGetErrors, KnowledgeNodesGetResults, KnowledgeNodesUpdateErrors, KnowledgeNodesUpdateResults, KnowledgePagesListErrors, KnowledgePagesListResults, KnowledgePromptErrors, KnowledgePromptResults, KnowledgeRegenerateTocErrors, KnowledgeRegenerateTocResults, ObservabilityGetErrors, ObservabilityGetResults, OutboundCallRequest, PatchCallBatchRequest, PatchConversationRequest, PatchEmailBatchRequest, PatchEmailRecipientRequest, PatchEmailSendRequest, PatchIntegrationRequest, PatchIntegrationTriggerRequest, PatchNodeRequest, PatchPhoneNumberRequest, PatchStreamConnectionRequest, PatchTaskRequest, PatchTelephonyAccountRequest, PatchToolRequest, PatchWebhookRequest, PreviewAnalysisRequest, ProviderKeysDeleteErrors, ProviderKeysDeleteResults, ProviderKeysListErrors, ProviderKeysListResults, ProviderKeysSetErrors, ProviderKeysSetResults, PublishToolRequest, RedraftRequest, RunTaskRequest, RunToolRequest, SchemasFunctionsGetErrors, SchemasFunctionsGetResults, SchemasGetErrors, SchemasGetResults, SecretsCreateErrors, SecretsCreateResults, SecretsDeleteErrors, SecretsDeleteResults, SecretsListErrors, SecretsListResults, SelectRecipientsRequest, SendMessageRequest, SetProviderKeyRequest, TasksCreateErrors, TasksCreateResults, TasksDeleteErrors, TasksDeleteResults, TasksGetErrors, TasksGetResults, TasksListErrors, TasksListResults, TasksPublishErrors, TasksPublishResults, TasksRunsCreateErrors, TasksRunsCreateResults, TasksRunsGetErrors, TasksRunsGetResults, TasksRunsListErrors, TasksRunsListResults, TasksUpdateErrors, TasksUpdateResults, TasksValidateErrors, TasksValidateResults, TasksVersionsGetErrors, TasksVersionsGetResults, TasksVersionsRollbackErrors, TasksVersionsRollbackResults, TelephonyAccountsCreateErrors, TelephonyAccountsCreateResults, TelephonyAccountsDeleteErrors, TelephonyAccountsDeleteResults, TelephonyAccountsGetErrors, TelephonyAccountsGetResults, TelephonyAccountsListErrors, TelephonyAccountsListResults, TelephonyAccountsProvisionErrors, TelephonyAccountsProvisionResults, TelephonyAccountsRemoteNumbersErrors, TelephonyAccountsRemoteNumbersResults, TelephonyAccountsUpdateErrors, TelephonyAccountsUpdateResults, TelephonyPhoneNumbersAssignErrors, TelephonyPhoneNumbersAssignResults, TelephonyPhoneNumbersGetErrors, TelephonyPhoneNumbersGetResults, TelephonyPhoneNumbersImportErrors, TelephonyPhoneNumbersImportResults, TelephonyPhoneNumbersListErrors, TelephonyPhoneNumbersListResults, TelephonyPhoneNumbersProvisionErrors, TelephonyPhoneNumbersProvisionResults, TelephonyPhoneNumbersUnassignErrors, TelephonyPhoneNumbersUnassignResults, TelephonyPhoneNumbersUpdateErrors, TelephonyPhoneNumbersUpdateResults, TelephonyProvidersListErrors, TelephonyProvidersListResults, TelephonyStreamsCreateErrors, TelephonyStreamsCreateResults, TelephonyStreamsDeleteErrors, TelephonyStreamsDeleteResults, TelephonyStreamsGetErrors, TelephonyStreamsGetResults, TelephonyStreamsListErrors, TelephonyStreamsListResults, TelephonyStreamsUpdateErrors, TelephonyStreamsUpdateResults, TextMessageRequest, TokenRequest, ToolsCreateErrors, ToolsCreateResults, ToolsDeleteErrors, ToolsDeleteResults, ToolsGetErrors, ToolsGetResults, ToolsListErrors, ToolsListResults, ToolsPublishErrors, ToolsPublishResults, ToolsRunErrors, ToolsRunResults, ToolsUpdateErrors, ToolsUpdateResults, ToolsValidateErrors, ToolsValidateResults, ToolsVersionsGetErrors, ToolsVersionsGetResults, ToolsVersionsRollbackErrors, ToolsVersionsRollbackResults, UpdateAgentRequest, WebhooksCreateErrors, WebhooksCreateResults, WebhooksDeleteErrors, WebhooksDeleteResults, WebhooksDeliveriesErrors, WebhooksDeliveriesResults, WebhooksEventTypesErrors, WebhooksEventTypesResults, WebhooksListErrors, WebhooksListResults, WebhooksRotateSecretErrors, WebhooksRotateSecretResults, WebhooksTestErrors, WebhooksTestResults, WebhooksUpdateErrors, WebhooksUpdateResults } from './types.gen.js';
6
6
 
7
7
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
8
8
  /**
@@ -975,7 +975,7 @@ export class Calls extends HeyApiClient {
975
975
  start?: string | null;
976
976
  end?: string | null;
977
977
  agent_id?: string | null;
978
- type?: 'WEB' | 'SIP_INBOUND' | 'SIP_OUTBOUND' | null;
978
+ type?: 'WEB' | 'SIP_INBOUND' | 'SIP_OUTBOUND' | 'STREAM' | null;
979
979
  status?: string | null;
980
980
  outcome?: string | null;
981
981
  contact_key?: string | null;
@@ -1252,6 +1252,41 @@ export class Avatars extends HeyApiClient {
1252
1252
  }
1253
1253
  }
1254
1254
 
1255
+ export class Models extends HeyApiClient {
1256
+ /**
1257
+ * Search Models
1258
+ *
1259
+ * Search the language models a provider offers too many of to list.
1260
+ *
1261
+ * `GET /catalog` carries every model except these. A provider marked
1262
+ * `browse: "search"` there — OpenRouter — reaches hundreds of models through
1263
+ * one key, so they are searched a page at a time instead. With no `q` the order
1264
+ * is real-world popularity. Everything returned is a valid `llm.model`.
1265
+ */
1266
+ public search<ThrowOnError extends boolean = false>(parameters?: {
1267
+ q?: string;
1268
+ limit?: number;
1269
+ cursor?: string;
1270
+ }, options?: Options<never, ThrowOnError>): RequestResult<CatalogModelsSearchResults, CatalogModelsSearchErrors, ThrowOnError, 'data'> {
1271
+ const params = buildClientParams([parameters], [{ args: [
1272
+ { in: 'query', key: 'q' },
1273
+ { in: 'query', key: 'limit' },
1274
+ { in: 'query', key: 'cursor' }
1275
+ ] }]);
1276
+ return (options?.client ?? this.client).get<CatalogModelsSearchResults, CatalogModelsSearchErrors, ThrowOnError, 'data'>({
1277
+ responseStyle: 'data',
1278
+ security: [{ scheme: 'bearer', type: 'http' }, {
1279
+ in: 'cookie',
1280
+ name: 'talqing_session',
1281
+ type: 'apiKey'
1282
+ }],
1283
+ url: '/v1/catalog/models',
1284
+ ...options,
1285
+ ...params
1286
+ });
1287
+ }
1288
+ }
1289
+
1255
1290
  export class Elevenlabs extends HeyApiClient {
1256
1291
  /**
1257
1292
  * Add Elevenlabs Voice
@@ -1383,6 +1418,10 @@ export class Catalog extends HeyApiClient {
1383
1418
  * `realtime` lists the speech-to-speech models. One of those replaces `stt`,
1384
1419
  * `llm` and `tts` together, so an agent sets either `realtime` or the three
1385
1420
  * cascade slots, never both.
1421
+ *
1422
+ * One provider's models are NOT here: a `providers` entry whose `browse` is
1423
+ * `search` reaches hundreds of them through one key, and they are searched
1424
+ * through `GET /catalog/models` instead.
1386
1425
  */
1387
1426
  public get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<CatalogGetResults, CatalogGetErrors, ThrowOnError, 'data'> {
1388
1427
  return (options?.client ?? this.client).get<CatalogGetResults, CatalogGetErrors, ThrowOnError, 'data'>({
@@ -1402,6 +1441,11 @@ export class Catalog extends HeyApiClient {
1402
1441
  return this._avatars ??= new Avatars({ client: this.client });
1403
1442
  }
1404
1443
 
1444
+ private _models?: Models;
1445
+ get models(): Models {
1446
+ return this._models ??= new Models({ client: this.client });
1447
+ }
1448
+
1405
1449
  private _voices?: Voices;
1406
1450
  get voices(): Voices {
1407
1451
  return this._voices ??= new Voices({ client: this.client });
@@ -2054,6 +2098,42 @@ export class Recipients2 extends HeyApiClient {
2054
2098
  });
2055
2099
  }
2056
2100
 
2101
+ /**
2102
+ * Redraft Email Batch Recipients
2103
+ *
2104
+ * Draft rows again from scratch. **Each one runs the task and is billed again.**
2105
+ *
2106
+ * `selection` is `failed` (drafting failed), `stale_version` (drafted by an
2107
+ * older published version of the task), `not_sent`, or `all` — which names
2108
+ * every row it refuses. Rows already sent or queued are never redrafted.
2109
+ *
2110
+ * This revives a batch that had finished drafting, and a person's edited cells
2111
+ * survive unless you pass `clear_overrides` — and are what the task is given.
2112
+ * Refused on a canceled batch, whose rows can never draft again.
2113
+ */
2114
+ public redraft<ThrowOnError extends boolean = false>(parameters: {
2115
+ batch_id: string;
2116
+ redraftRequest: RedraftRequest;
2117
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesRecipientsRedraftResults, EmailBatchesRecipientsRedraftErrors, ThrowOnError, 'data'> {
2118
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'redraftRequest', map: 'body' }] }]);
2119
+ return (options?.client ?? this.client).post<EmailBatchesRecipientsRedraftResults, EmailBatchesRecipientsRedraftErrors, ThrowOnError, 'data'>({
2120
+ responseStyle: 'data',
2121
+ security: [{ scheme: 'bearer', type: 'http' }, {
2122
+ in: 'cookie',
2123
+ name: 'talqing_session',
2124
+ type: 'apiKey'
2125
+ }],
2126
+ url: '/v1/email/batches/{batch_id}/redraft',
2127
+ ...options,
2128
+ ...params,
2129
+ headers: {
2130
+ 'Content-Type': 'application/json',
2131
+ ...options?.headers,
2132
+ ...params.headers
2133
+ }
2134
+ });
2135
+ }
2136
+
2057
2137
  /**
2058
2138
  * Restore Email Batch Recipients
2059
2139
  *
@@ -2083,29 +2163,26 @@ export class Recipients2 extends HeyApiClient {
2083
2163
  }
2084
2164
 
2085
2165
  /**
2086
- * Retry Email Batch Recipients
2166
+ * Skip Email Batch Recipients
2087
2167
  *
2088
- * Draft rows whose first attempt failed, again.
2168
+ * Take rows out of consideration. Reversible with `restore`.
2089
2169
  *
2090
- * `selection: "all_eligible"` means every row whose drafting failed. This is
2091
- * the one action that revives a batch that has already finished drafting: it
2092
- * goes back to `drafting` and picks up exactly the rows you retried — the
2093
- * alternative would be telling you that twelve failed rows are unrecoverable
2094
- * because the other 4 988 finished first.
2170
+ * Accepts drafted rows and rows whose drafting failed. Takes either
2171
+ * `recipient_ids` or `selection: "all_eligible"`, which here means both.
2095
2172
  */
2096
- public retry<ThrowOnError extends boolean = false>(parameters: {
2173
+ public skip<ThrowOnError extends boolean = false>(parameters: {
2097
2174
  batch_id: string;
2098
2175
  selectRecipientsRequest: SelectRecipientsRequest;
2099
- }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesRecipientsRetryResults, EmailBatchesRecipientsRetryErrors, ThrowOnError, 'data'> {
2176
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesRecipientsSkipResults, EmailBatchesRecipientsSkipErrors, ThrowOnError, 'data'> {
2100
2177
  const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
2101
- return (options?.client ?? this.client).post<EmailBatchesRecipientsRetryResults, EmailBatchesRecipientsRetryErrors, ThrowOnError, 'data'>({
2178
+ return (options?.client ?? this.client).post<EmailBatchesRecipientsSkipResults, EmailBatchesRecipientsSkipErrors, ThrowOnError, 'data'>({
2102
2179
  responseStyle: 'data',
2103
2180
  security: [{ scheme: 'bearer', type: 'http' }, {
2104
2181
  in: 'cookie',
2105
2182
  name: 'talqing_session',
2106
2183
  type: 'apiKey'
2107
2184
  }],
2108
- url: '/v1/email/batches/{batch_id}/retry',
2185
+ url: '/v1/email/batches/{batch_id}/skip',
2109
2186
  ...options,
2110
2187
  ...params,
2111
2188
  headers: {
@@ -2115,33 +2192,64 @@ export class Recipients2 extends HeyApiClient {
2115
2192
  }
2116
2193
  });
2117
2194
  }
2195
+ }
2196
+
2197
+ export class Sends extends HeyApiClient {
2198
+ /**
2199
+ * List Email Sends
2200
+ *
2201
+ * Every send on this batch, newest first, with its counts and its schedule.
2202
+ */
2203
+ public list<ThrowOnError extends boolean = false>(parameters: {
2204
+ batch_id: string;
2205
+ limit?: number;
2206
+ offset?: number;
2207
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesSendsListResults, EmailBatchesSendsListErrors, ThrowOnError, 'data'> {
2208
+ const params = buildClientParams([parameters], [{ args: [
2209
+ { in: 'path', key: 'batch_id' },
2210
+ { in: 'query', key: 'limit' },
2211
+ { in: 'query', key: 'offset' }
2212
+ ] }]);
2213
+ return (options?.client ?? this.client).get<EmailBatchesSendsListResults, EmailBatchesSendsListErrors, ThrowOnError, 'data'>({
2214
+ responseStyle: 'data',
2215
+ security: [{ scheme: 'bearer', type: 'http' }, {
2216
+ in: 'cookie',
2217
+ name: 'talqing_session',
2218
+ type: 'apiKey'
2219
+ }],
2220
+ url: '/v1/email/batches/{batch_id}/sends',
2221
+ ...options,
2222
+ ...params
2223
+ });
2224
+ }
2118
2225
 
2119
2226
  /**
2120
- * Send Email Batch Recipients
2227
+ * Create Email Send
2121
2228
  *
2122
- * Send the rows you name. **This mails real people and cannot be undone.**
2229
+ * Send these rows. **This mails real people and cannot be undone.**
2123
2230
  *
2124
- * At most 50 rows per call, named one by one — there is no "select all" and no
2125
- * bulk form of this. A row whose `to`, `subject` or `body` does not resolve
2126
- * comes back in `rejected` and stays a draft; fix it with
2127
- * `patch_email_batch_recipient` and try again.
2231
+ * Name `recipient_ids`, or pass `selection: "all_drafts"` for every reviewed
2232
+ * draft. A row whose `to`, `subject` or `body` does not resolve comes back in
2233
+ * `rejected` and stays a draft; fix it with `patch_email_batch_recipient`.
2128
2234
  *
2129
- * `from_email`, `from_name` and `reply_to` override the sender for this call
2130
- * only, and must be on a domain verified on the same Resend account.
2235
+ * The send is a row you can steer: `start_at` schedules it, `window` holds it
2236
+ * to business hours, `send_gap_seconds` paces it and `send_daily_cap` bounds
2237
+ * how many leave per day. Everything omitted comes from the batch. Cancel it
2238
+ * and every unsent row comes back as a draft.
2131
2239
  */
2132
- public send<ThrowOnError extends boolean = false>(parameters: {
2240
+ public create<ThrowOnError extends boolean = false>(parameters: {
2133
2241
  batch_id: string;
2134
- sendEmailBatchRequest: SendEmailBatchRequest;
2135
- }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesRecipientsSendResults, EmailBatchesRecipientsSendErrors, ThrowOnError, 'data'> {
2136
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'sendEmailBatchRequest', map: 'body' }] }]);
2137
- return (options?.client ?? this.client).post<EmailBatchesRecipientsSendResults, EmailBatchesRecipientsSendErrors, ThrowOnError, 'data'>({
2242
+ createEmailSendRequest: CreateEmailSendRequest;
2243
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesSendsCreateResults, EmailBatchesSendsCreateErrors, ThrowOnError, 'data'> {
2244
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'createEmailSendRequest', map: 'body' }] }]);
2245
+ return (options?.client ?? this.client).post<EmailBatchesSendsCreateResults, EmailBatchesSendsCreateErrors, ThrowOnError, 'data'>({
2138
2246
  responseStyle: 'data',
2139
2247
  security: [{ scheme: 'bearer', type: 'http' }, {
2140
2248
  in: 'cookie',
2141
2249
  name: 'talqing_session',
2142
2250
  type: 'apiKey'
2143
2251
  }],
2144
- url: '/v1/email/batches/{batch_id}/send',
2252
+ url: '/v1/email/batches/{batch_id}/sends',
2145
2253
  ...options,
2146
2254
  ...params,
2147
2255
  headers: {
@@ -2153,27 +2261,57 @@ export class Recipients2 extends HeyApiClient {
2153
2261
  }
2154
2262
 
2155
2263
  /**
2156
- * Skip Email Batch Recipients
2264
+ * Get Email Send
2157
2265
  *
2158
- * Take drafted rows out of consideration. Reversible with `restore`.
2266
+ * One send: where its rows are, and when it next does something.
2159
2267
  *
2160
- * Takes either `recipient_ids` or `selection: "all_eligible"`, which here means
2161
- * every row that has a draft. The reversible verbs keep that shorthand while
2162
- * `send` does not, because the rule is about irreversibility rather than bulk.
2268
+ * `next_send_reason` says which gate is holding it — `start`, `window`,
2269
+ * `daily_cap`, `retry` or `gap`.
2163
2270
  */
2164
- public skip<ThrowOnError extends boolean = false>(parameters: {
2271
+ public get<ThrowOnError extends boolean = false>(parameters: {
2165
2272
  batch_id: string;
2166
- selectRecipientsRequest: SelectRecipientsRequest;
2167
- }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesRecipientsSkipResults, EmailBatchesRecipientsSkipErrors, ThrowOnError, 'data'> {
2168
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
2169
- return (options?.client ?? this.client).post<EmailBatchesRecipientsSkipResults, EmailBatchesRecipientsSkipErrors, ThrowOnError, 'data'>({
2273
+ send_id: string;
2274
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesSendsGetResults, EmailBatchesSendsGetErrors, ThrowOnError, 'data'> {
2275
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { in: 'path', key: 'send_id' }] }]);
2276
+ return (options?.client ?? this.client).get<EmailBatchesSendsGetResults, EmailBatchesSendsGetErrors, ThrowOnError, 'data'>({
2170
2277
  responseStyle: 'data',
2171
2278
  security: [{ scheme: 'bearer', type: 'http' }, {
2172
2279
  in: 'cookie',
2173
2280
  name: 'talqing_session',
2174
2281
  type: 'apiKey'
2175
2282
  }],
2176
- url: '/v1/email/batches/{batch_id}/skip',
2283
+ url: '/v1/email/batches/{batch_id}/sends/{send_id}',
2284
+ ...options,
2285
+ ...params
2286
+ });
2287
+ }
2288
+
2289
+ /**
2290
+ * Patch Email Send
2291
+ *
2292
+ * Re-steer one send: its pace, its hours, its daily cap, its start time.
2293
+ *
2294
+ * Never its sender, and never which rows it holds — to change that, cancel it
2295
+ * and create another. `start_at` moves only before the send has begun.
2296
+ */
2297
+ public update<ThrowOnError extends boolean = false>(parameters: {
2298
+ batch_id: string;
2299
+ send_id: string;
2300
+ patchEmailSendRequest: PatchEmailSendRequest;
2301
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesSendsUpdateResults, EmailBatchesSendsUpdateErrors, ThrowOnError, 'data'> {
2302
+ const params = buildClientParams([parameters], [{ args: [
2303
+ { in: 'path', key: 'batch_id' },
2304
+ { in: 'path', key: 'send_id' },
2305
+ { key: 'patchEmailSendRequest', map: 'body' }
2306
+ ] }]);
2307
+ return (options?.client ?? this.client).patch<EmailBatchesSendsUpdateResults, EmailBatchesSendsUpdateErrors, ThrowOnError, 'data'>({
2308
+ responseStyle: 'data',
2309
+ security: [{ scheme: 'bearer', type: 'http' }, {
2310
+ in: 'cookie',
2311
+ name: 'talqing_session',
2312
+ type: 'apiKey'
2313
+ }],
2314
+ url: '/v1/email/batches/{batch_id}/sends/{send_id}',
2177
2315
  ...options,
2178
2316
  ...params,
2179
2317
  headers: {
@@ -2183,6 +2321,80 @@ export class Recipients2 extends HeyApiClient {
2183
2321
  }
2184
2322
  });
2185
2323
  }
2324
+
2325
+ /**
2326
+ * Cancel Email Send
2327
+ *
2328
+ * Stop this send, and give every row it has not sent back as a draft.
2329
+ *
2330
+ * Not a destructive action: the drafts come back exactly as they were, ready
2331
+ * for another send. It is also the only way to change what a scheduled send
2332
+ * contains — a send's rows are fixed once it exists.
2333
+ */
2334
+ public cancel<ThrowOnError extends boolean = false>(parameters: {
2335
+ batch_id: string;
2336
+ send_id: string;
2337
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesSendsCancelResults, EmailBatchesSendsCancelErrors, ThrowOnError, 'data'> {
2338
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { in: 'path', key: 'send_id' }] }]);
2339
+ return (options?.client ?? this.client).post<EmailBatchesSendsCancelResults, EmailBatchesSendsCancelErrors, ThrowOnError, 'data'>({
2340
+ responseStyle: 'data',
2341
+ security: [{ scheme: 'bearer', type: 'http' }, {
2342
+ in: 'cookie',
2343
+ name: 'talqing_session',
2344
+ type: 'apiKey'
2345
+ }],
2346
+ url: '/v1/email/batches/{batch_id}/sends/{send_id}/cancel',
2347
+ ...options,
2348
+ ...params
2349
+ });
2350
+ }
2351
+
2352
+ /**
2353
+ * Pause Email Send
2354
+ *
2355
+ * Stop sending. It takes hold on the next email, and nothing is lost —
2356
+ * the rows stay queued for whenever you resume.
2357
+ */
2358
+ public pause<ThrowOnError extends boolean = false>(parameters: {
2359
+ batch_id: string;
2360
+ send_id: string;
2361
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesSendsPauseResults, EmailBatchesSendsPauseErrors, ThrowOnError, 'data'> {
2362
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { in: 'path', key: 'send_id' }] }]);
2363
+ return (options?.client ?? this.client).post<EmailBatchesSendsPauseResults, EmailBatchesSendsPauseErrors, ThrowOnError, 'data'>({
2364
+ responseStyle: 'data',
2365
+ security: [{ scheme: 'bearer', type: 'http' }, {
2366
+ in: 'cookie',
2367
+ name: 'talqing_session',
2368
+ type: 'apiKey'
2369
+ }],
2370
+ url: '/v1/email/batches/{batch_id}/sends/{send_id}/pause',
2371
+ ...options,
2372
+ ...params
2373
+ });
2374
+ }
2375
+
2376
+ /**
2377
+ * Resume Email Send
2378
+ *
2379
+ * Undo a pause and carry on from where it stopped.
2380
+ */
2381
+ public resume<ThrowOnError extends boolean = false>(parameters: {
2382
+ batch_id: string;
2383
+ send_id: string;
2384
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBatchesSendsResumeResults, EmailBatchesSendsResumeErrors, ThrowOnError, 'data'> {
2385
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { in: 'path', key: 'send_id' }] }]);
2386
+ return (options?.client ?? this.client).post<EmailBatchesSendsResumeResults, EmailBatchesSendsResumeErrors, ThrowOnError, 'data'>({
2387
+ responseStyle: 'data',
2388
+ security: [{ scheme: 'bearer', type: 'http' }, {
2389
+ in: 'cookie',
2390
+ name: 'talqing_session',
2391
+ type: 'apiKey'
2392
+ }],
2393
+ url: '/v1/email/batches/{batch_id}/sends/{send_id}/resume',
2394
+ ...options,
2395
+ ...params
2396
+ });
2397
+ }
2186
2398
  }
2187
2399
 
2188
2400
  export class Batches2 extends HeyApiClient {
@@ -2230,13 +2442,16 @@ export class Batches2 extends HeyApiClient {
2230
2442
  * scraped contacts — and this runs on your account under your agreement.
2231
2443
  *
2232
2444
  * **Nothing is sent that a person has not selected.** Creating a batch only
2233
- * starts drafting; sending is a separate call over at most 50 named rows.
2445
+ * starts drafting; sending is a separate call that creates a send you can
2446
+ * schedule, pace, pause and cancel.
2234
2447
  *
2235
- * **Every row runs your task as it stands right now** — a task has no
2236
- * versions, so editing it mid-batch changes every row drafted after that.
2448
+ * **Every row runs the task's CURRENT published version**, re-read every pass,
2449
+ * so publishing a better prompt mid-batch changes every row drafted after it.
2237
2450
  *
2238
2451
  * `field_map` points `to`, `subject` and `body` at a column of your list or at
2239
- * a field the task produces. An invalid batch is a 400 listing every problem.
2452
+ * a field the task produces. `window` is when email may LEAVE, inherited by
2453
+ * every send; drafting is not restricted by hours. An invalid batch is a 400
2454
+ * listing every problem.
2240
2455
  *
2241
2456
  * There is no spend cap: every row runs the task and is billed, so a 5 000-row
2242
2457
  * batch doing research costs 5 000 task runs whether or not anything is sent.
@@ -2268,8 +2483,8 @@ export class Batches2 extends HeyApiClient {
2268
2483
  *
2269
2484
  * One batch: its policy, its per-status counts and what drafting has cost.
2270
2485
  *
2271
- * While the batch is waiting on a start time or a closed window, the response
2272
- * also carries `next_draft_at`.
2486
+ * `drafted_versions` says which published version of the task wrote how many
2487
+ * rows, and `sent_today` how much of `send_daily_cap` is left today.
2273
2488
  */
2274
2489
  public get<ThrowOnError extends boolean = false>(parameters: {
2275
2490
  batch_id: string;
@@ -2293,10 +2508,12 @@ export class Batches2 extends HeyApiClient {
2293
2508
  *
2294
2509
  * Edit a batch's policy. The next drafting pass reads the new row.
2295
2510
  *
2296
- * Pacing and the calling window are editable at any time. The sender, the body
2297
- * format and the field map freeze once the batch has sent anything changing
2298
- * them then would make the rows already delivered no longer describe what they
2299
- * were sent as. `start_at` moves only while the batch is still scheduled.
2511
+ * Pacing, the window and the daily cap are editable at any time; the sending
2512
+ * half is the DEFAULT for the next send, and a send already created carries its
2513
+ * own copy. The sender, the body format and the field map freeze once the batch
2514
+ * has sent anything changing them then would make the rows already delivered
2515
+ * no longer describe what they were sent as. `start_at` moves only while the
2516
+ * batch is still scheduled.
2300
2517
  */
2301
2518
  public update<ThrowOnError extends boolean = false>(parameters: {
2302
2519
  batch_id: string;
@@ -2324,12 +2541,12 @@ export class Batches2 extends HeyApiClient {
2324
2541
  /**
2325
2542
  * Cancel Email Batch
2326
2543
  *
2327
- * Stop drafting for good. This is the only terminal action a batch cannot
2328
- * be deleted, because it is the record of what was sent to whom.
2544
+ * Stop drafting for good. A batch cannot be deleted, because it is the
2545
+ * record of what was sent to whom.
2329
2546
  *
2330
- * Rows already drafted are **not** touched: cancelling stops drafting, and
2331
- * drafts already produced are still worth reviewing and sending. Rows never
2332
- * reached report as `canceled`.
2547
+ * Rows already drafted are **not** touched and neither is any send: cancelling
2548
+ * stops drafting, and drafts already produced are still worth reviewing and
2549
+ * sending. Rows never reached report as `canceled`.
2333
2550
  */
2334
2551
  public cancel<ThrowOnError extends boolean = false>(parameters: {
2335
2552
  batch_id: string;
@@ -2399,6 +2616,11 @@ export class Batches2 extends HeyApiClient {
2399
2616
  get recipients(): Recipients2 {
2400
2617
  return this._recipients ??= new Recipients2({ client: this.client });
2401
2618
  }
2619
+
2620
+ private _sends?: Sends;
2621
+ get sends(): Sends {
2622
+ return this._sends ??= new Sends({ client: this.client });
2623
+ }
2402
2624
  }
2403
2625
 
2404
2626
  export class Senders extends HeyApiClient {
@@ -3341,65 +3563,50 @@ export class Secrets extends HeyApiClient {
3341
3563
  }
3342
3564
  }
3343
3565
 
3344
- export class Runs extends HeyApiClient {
3566
+ export class Streams extends HeyApiClient {
3345
3567
  /**
3346
- * List Task Runs
3347
- *
3348
- * This task's runs, newest first, each with its output, trace and cost.
3568
+ * List Stream Connections
3349
3569
  *
3350
- * A run records the task's *name* and nothing else about the definition it ran
3351
- * under, so two runs either side of an edit are indistinguishable here.
3570
+ * List WebSocket media-stream connections a partner can dial.
3352
3571
  */
3353
- public list<ThrowOnError extends boolean = false>(parameters: {
3354
- task_id: string;
3572
+ public list<ThrowOnError extends boolean = false>(parameters?: {
3355
3573
  limit?: number;
3356
3574
  offset?: number;
3357
- }, options?: Options<never, ThrowOnError>): RequestResult<TasksRunsListResults, TasksRunsListErrors, ThrowOnError, 'data'> {
3358
- const params = buildClientParams([parameters], [{ args: [
3359
- { in: 'path', key: 'task_id' },
3360
- { in: 'query', key: 'limit' },
3361
- { in: 'query', key: 'offset' }
3362
- ] }]);
3363
- return (options?.client ?? this.client).get<TasksRunsListResults, TasksRunsListErrors, ThrowOnError, 'data'>({
3575
+ }, options?: Options<never, ThrowOnError>): RequestResult<TelephonyStreamsListResults, TelephonyStreamsListErrors, ThrowOnError, 'data'> {
3576
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3577
+ return (options?.client ?? this.client).get<TelephonyStreamsListResults, TelephonyStreamsListErrors, ThrowOnError, 'data'>({
3364
3578
  responseStyle: 'data',
3365
3579
  security: [{ scheme: 'bearer', type: 'http' }, {
3366
3580
  in: 'cookie',
3367
3581
  name: 'talqing_session',
3368
3582
  type: 'apiKey'
3369
3583
  }],
3370
- url: '/v1/tasks/{task_id}/runs',
3584
+ url: '/v1/streams',
3371
3585
  ...options,
3372
3586
  ...params
3373
3587
  });
3374
3588
  }
3375
3589
 
3376
3590
  /**
3377
- * Run Task
3591
+ * Create Stream Connection
3378
3592
  *
3379
- * Run the task once with the variables you supply, and wait for the result.
3380
- *
3381
- * **This executes for real**: the tools call your endpoints with your secrets,
3382
- * the MCP servers spend your credits, and the model spends your tokens. A task
3383
- * that books a slot, charges a card or sends a message will do so.
3593
+ * Create a connection a streaming partner can dial.
3384
3594
  *
3385
- * `vars` must match what the task declares an unknown name is refused rather
3386
- * than dropped. The response is the whole run: the structured `output`, a
3387
- * `trace` of every tool call, the steps used and what the tokens cost. On
3388
- * failure `error.type` says whose problem it is. Secrets are redacted.
3595
+ * One connection per agent per dialect: the URL names both, so a second would
3596
+ * only be the same URL again.
3389
3597
  */
3390
3598
  public create<ThrowOnError extends boolean = false>(parameters: {
3391
- task_id: string;
3392
- runTaskRequest: RunTaskRequest;
3393
- }, options?: Options<never, ThrowOnError>): RequestResult<TasksRunsCreateResults, TasksRunsCreateErrors, ThrowOnError, 'data'> {
3394
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'runTaskRequest', map: 'body' }] }]);
3395
- return (options?.client ?? this.client).post<TasksRunsCreateResults, TasksRunsCreateErrors, ThrowOnError, 'data'>({
3599
+ createStreamConnectionRequest: CreateStreamConnectionRequest;
3600
+ }, options?: Options<never, ThrowOnError>): RequestResult<TelephonyStreamsCreateResults, TelephonyStreamsCreateErrors, ThrowOnError, 'data'> {
3601
+ const params = buildClientParams([parameters], [{ args: [{ key: 'createStreamConnectionRequest', map: 'body' }] }]);
3602
+ return (options?.client ?? this.client).post<TelephonyStreamsCreateResults, TelephonyStreamsCreateErrors, ThrowOnError, 'data'>({
3396
3603
  responseStyle: 'data',
3397
3604
  security: [{ scheme: 'bearer', type: 'http' }, {
3398
3605
  in: 'cookie',
3399
3606
  name: 'talqing_session',
3400
3607
  type: 'apiKey'
3401
3608
  }],
3402
- url: '/v1/tasks/{task_id}/runs',
3609
+ url: '/v1/streams',
3403
3610
  ...options,
3404
3611
  ...params,
3405
3612
  headers: {
@@ -3411,93 +3618,70 @@ export class Runs extends HeyApiClient {
3411
3618
  }
3412
3619
 
3413
3620
  /**
3414
- * Get Task Run
3621
+ * Delete Stream Connection
3415
3622
  *
3416
- * One run in full: what it produced, every tool it called on the way, and
3417
- * what it cost.
3418
- *
3419
- * This is what answers "why did it write that" for a caller holding one run id
3420
- * — an email batch's review table links each drafted row here. Secret values
3421
- * are redacted from the trace, and a trace that was cut reports it.
3623
+ * Delete a stream connection. Calls it already carried are kept.
3422
3624
  */
3423
- public get<ThrowOnError extends boolean = false>(parameters: {
3424
- task_id: string;
3425
- run_id: string;
3426
- }, options?: Options<never, ThrowOnError>): RequestResult<TasksRunsGetResults, TasksRunsGetErrors, ThrowOnError, 'data'> {
3427
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'run_id' }] }]);
3428
- return (options?.client ?? this.client).get<TasksRunsGetResults, TasksRunsGetErrors, ThrowOnError, 'data'>({
3625
+ public delete<ThrowOnError extends boolean = false>(parameters: {
3626
+ connection_id: string;
3627
+ }, options?: Options<never, ThrowOnError>): RequestResult<TelephonyStreamsDeleteResults, TelephonyStreamsDeleteErrors, ThrowOnError, 'data'> {
3628
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'connection_id' }] }]);
3629
+ return (options?.client ?? this.client).delete<TelephonyStreamsDeleteResults, TelephonyStreamsDeleteErrors, ThrowOnError, 'data'>({
3429
3630
  responseStyle: 'data',
3430
3631
  security: [{ scheme: 'bearer', type: 'http' }, {
3431
3632
  in: 'cookie',
3432
3633
  name: 'talqing_session',
3433
3634
  type: 'apiKey'
3434
3635
  }],
3435
- url: '/v1/tasks/{task_id}/runs/{run_id}',
3636
+ url: '/v1/streams/{connection_id}',
3436
3637
  ...options,
3437
3638
  ...params
3438
3639
  });
3439
3640
  }
3440
- }
3441
-
3442
- export class Tasks2 extends HeyApiClient {
3641
+
3443
3642
  /**
3444
- * List Tasks
3445
- *
3446
- * List the workspace's agent tasks.
3643
+ * Get Stream Connection
3447
3644
  *
3448
- * A task is an agent nobody talks to: a prompt, one LLM, tools and MCP
3449
- * servers, the variables it takes as input, and the typed result it must
3450
- * produce. `last_run` says how the most recent run of each one went, so a
3451
- * task whose prompt stopped calling `submit_result` is visible here rather
3452
- * than only in its own history.
3645
+ * One stream connection, with the URL to hand the partner.
3453
3646
  */
3454
- public list<ThrowOnError extends boolean = false>(parameters?: {
3455
- limit?: number;
3456
- offset?: number;
3457
- }, options?: Options<never, ThrowOnError>): RequestResult<TasksListResults, TasksListErrors, ThrowOnError, 'data'> {
3458
- const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3459
- return (options?.client ?? this.client).get<TasksListResults, TasksListErrors, ThrowOnError, 'data'>({
3647
+ public get<ThrowOnError extends boolean = false>(parameters: {
3648
+ connection_id: string;
3649
+ }, options?: Options<never, ThrowOnError>): RequestResult<TelephonyStreamsGetResults, TelephonyStreamsGetErrors, ThrowOnError, 'data'> {
3650
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'connection_id' }] }]);
3651
+ return (options?.client ?? this.client).get<TelephonyStreamsGetResults, TelephonyStreamsGetErrors, ThrowOnError, 'data'>({
3460
3652
  responseStyle: 'data',
3461
3653
  security: [{ scheme: 'bearer', type: 'http' }, {
3462
3654
  in: 'cookie',
3463
3655
  name: 'talqing_session',
3464
3656
  type: 'apiKey'
3465
3657
  }],
3466
- url: '/v1/tasks',
3658
+ url: '/v1/streams/{connection_id}',
3467
3659
  ...options,
3468
3660
  ...params
3469
3661
  });
3470
3662
  }
3471
3663
 
3472
3664
  /**
3473
- * Create Task
3665
+ * Patch Stream Connection
3474
3666
  *
3475
- * Create an agent task: an agent nobody talks to, which takes named inputs
3476
- * and returns a typed result.
3477
- *
3478
- * A task has no draft and no publish step: it is valid the moment it saves and
3479
- * callable immediately. An invalid config is a 400 listing every problem and
3480
- * nothing is stored.
3481
- *
3482
- * `output` is what makes this a task rather than a chat agent — declare the
3483
- * fields the model must produce and it is given a `submit_result` tool built
3484
- * from them. `vars` are its inputs, read as `{{vars.name}}`.
3667
+ * Rename a connection, point it at another agent, or disable it.
3485
3668
  *
3486
- * `warnings` reports the non-fatal problems. There is no publish screen to
3487
- * show them on, so read them here.
3669
+ * Disabling refuses new calls immediately and is the only way to stop a URL
3670
+ * answering; calls already running are untouched.
3488
3671
  */
3489
- public create<ThrowOnError extends boolean = false>(parameters: {
3490
- createTaskRequest: CreateTaskRequest;
3491
- }, options?: Options<never, ThrowOnError>): RequestResult<TasksCreateResults, TasksCreateErrors, ThrowOnError, 'data'> {
3492
- const params = buildClientParams([parameters], [{ args: [{ key: 'createTaskRequest', map: 'body' }] }]);
3493
- return (options?.client ?? this.client).post<TasksCreateResults, TasksCreateErrors, ThrowOnError, 'data'>({
3672
+ public update<ThrowOnError extends boolean = false>(parameters: {
3673
+ connection_id: string;
3674
+ patchStreamConnectionRequest: PatchStreamConnectionRequest;
3675
+ }, options?: Options<never, ThrowOnError>): RequestResult<TelephonyStreamsUpdateResults, TelephonyStreamsUpdateErrors, ThrowOnError, 'data'> {
3676
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'connection_id' }, { key: 'patchStreamConnectionRequest', map: 'body' }] }]);
3677
+ return (options?.client ?? this.client).patch<TelephonyStreamsUpdateResults, TelephonyStreamsUpdateErrors, ThrowOnError, 'data'>({
3494
3678
  responseStyle: 'data',
3495
3679
  security: [{ scheme: 'bearer', type: 'http' }, {
3496
3680
  in: 'cookie',
3497
3681
  name: 'talqing_session',
3498
3682
  type: 'apiKey'
3499
3683
  }],
3500
- url: '/v1/tasks',
3684
+ url: '/v1/streams/{connection_id}',
3501
3685
  ...options,
3502
3686
  ...params,
3503
3687
  headers: {
@@ -3507,121 +3691,39 @@ export class Tasks2 extends HeyApiClient {
3507
3691
  }
3508
3692
  });
3509
3693
  }
3510
-
3694
+ }
3695
+
3696
+ export class Accounts extends HeyApiClient {
3511
3697
  /**
3512
- * Delete Task
3698
+ * List Telephony Accounts
3699
+ *
3700
+ * List the workspace's connected carrier accounts.
3513
3701
  *
3514
- * Delete a task. Its run history survives, still named after it.
3702
+ * A carrier account is the credential Talqing uses to reach a phone network;
3703
+ * phone numbers hang off one. `setup_complete` and `setup_steps` say whether
3704
+ * it is finished — including the steps that can only be done in the carrier's
3705
+ * own console.
3515
3706
  */
3516
- public delete<ThrowOnError extends boolean = false>(parameters: {
3517
- task_id: string;
3518
- }, options?: Options<never, ThrowOnError>): RequestResult<TasksDeleteResults, TasksDeleteErrors, ThrowOnError, 'data'> {
3519
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3520
- return (options?.client ?? this.client).delete<TasksDeleteResults, TasksDeleteErrors, ThrowOnError, 'data'>({
3707
+ public list<ThrowOnError extends boolean = false>(parameters?: {
3708
+ limit?: number;
3709
+ offset?: number;
3710
+ }, options?: Options<never, ThrowOnError>): RequestResult<TelephonyAccountsListResults, TelephonyAccountsListErrors, ThrowOnError, 'data'> {
3711
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3712
+ return (options?.client ?? this.client).get<TelephonyAccountsListResults, TelephonyAccountsListErrors, ThrowOnError, 'data'>({
3521
3713
  responseStyle: 'data',
3522
3714
  security: [{ scheme: 'bearer', type: 'http' }, {
3523
3715
  in: 'cookie',
3524
3716
  name: 'talqing_session',
3525
3717
  type: 'apiKey'
3526
3718
  }],
3527
- url: '/v1/tasks/{task_id}',
3719
+ url: '/v1/telephony/accounts',
3528
3720
  ...options,
3529
3721
  ...params
3530
3722
  });
3531
3723
  }
3532
3724
 
3533
3725
  /**
3534
- * Get Task
3535
- *
3536
- * Fetch one task's config and how its last run went.
3537
- */
3538
- public get<ThrowOnError extends boolean = false>(parameters: {
3539
- task_id: string;
3540
- }, options?: Options<never, ThrowOnError>): RequestResult<TasksGetResults, TasksGetErrors, ThrowOnError, 'data'> {
3541
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3542
- return (options?.client ?? this.client).get<TasksGetResults, TasksGetErrors, ThrowOnError, 'data'>({
3543
- responseStyle: 'data',
3544
- security: [{ scheme: 'bearer', type: 'http' }, {
3545
- in: 'cookie',
3546
- name: 'talqing_session',
3547
- type: 'apiKey'
3548
- }],
3549
- url: '/v1/tasks/{task_id}',
3550
- ...options,
3551
- ...params
3552
- });
3553
- }
3554
-
3555
- /**
3556
- * Update Task
3557
- *
3558
- * Replace a task's config.
3559
- *
3560
- * The whole config is sent, so include every field you mean to keep, and it is
3561
- * validated exactly as `create_task` is. The edit takes effect on the next run
3562
- * — a task has no versions, so there is no old wording to go back to and no
3563
- * record of which definition produced an earlier run.
3564
- */
3565
- public update<ThrowOnError extends boolean = false>(parameters: {
3566
- task_id: string;
3567
- patchTaskRequest: PatchTaskRequest;
3568
- }, options?: Options<never, ThrowOnError>): RequestResult<TasksUpdateResults, TasksUpdateErrors, ThrowOnError, 'data'> {
3569
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'patchTaskRequest', map: 'body' }] }]);
3570
- return (options?.client ?? this.client).patch<TasksUpdateResults, TasksUpdateErrors, ThrowOnError, 'data'>({
3571
- responseStyle: 'data',
3572
- security: [{ scheme: 'bearer', type: 'http' }, {
3573
- in: 'cookie',
3574
- name: 'talqing_session',
3575
- type: 'apiKey'
3576
- }],
3577
- url: '/v1/tasks/{task_id}',
3578
- ...options,
3579
- ...params,
3580
- headers: {
3581
- 'Content-Type': 'application/json',
3582
- ...options?.headers,
3583
- ...params.headers
3584
- }
3585
- });
3586
- }
3587
-
3588
- private _runs?: Runs;
3589
- get runs(): Runs {
3590
- return this._runs ??= new Runs({ client: this.client });
3591
- }
3592
- }
3593
-
3594
- export class Accounts extends HeyApiClient {
3595
- /**
3596
- * List Telephony Accounts
3597
- *
3598
- * List the workspace's connected carrier accounts.
3599
- *
3600
- * A carrier account is the credential Talqing uses to reach a phone network;
3601
- * phone numbers hang off one. `setup_complete` and `setup_steps` say whether
3602
- * it is finished — including the steps that can only be done in the carrier's
3603
- * own console.
3604
- */
3605
- public list<ThrowOnError extends boolean = false>(parameters?: {
3606
- limit?: number;
3607
- offset?: number;
3608
- }, options?: Options<never, ThrowOnError>): RequestResult<TelephonyAccountsListResults, TelephonyAccountsListErrors, ThrowOnError, 'data'> {
3609
- const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3610
- return (options?.client ?? this.client).get<TelephonyAccountsListResults, TelephonyAccountsListErrors, ThrowOnError, 'data'>({
3611
- responseStyle: 'data',
3612
- security: [{ scheme: 'bearer', type: 'http' }, {
3613
- in: 'cookie',
3614
- name: 'talqing_session',
3615
- type: 'apiKey'
3616
- }],
3617
- url: '/v1/telephony/accounts',
3618
- ...options,
3619
- ...params
3620
- });
3621
- }
3622
-
3623
- /**
3624
- * Create Telephony Account
3726
+ * Create Telephony Account
3625
3727
  *
3626
3728
  * Connect a carrier account so the workspace can own phone numbers.
3627
3729
  *
@@ -4035,6 +4137,11 @@ export class Providers extends HeyApiClient {
4035
4137
  }
4036
4138
 
4037
4139
  export class Telephony extends HeyApiClient {
4140
+ private _streams?: Streams;
4141
+ get streams(): Streams {
4142
+ return this._streams ??= new Streams({ client: this.client });
4143
+ }
4144
+
4038
4145
  private _accounts?: Accounts;
4039
4146
  get accounts(): Accounts {
4040
4147
  return this._accounts ??= new Accounts({ client: this.client });
@@ -4051,7 +4158,367 @@ export class Telephony extends HeyApiClient {
4051
4158
  }
4052
4159
  }
4053
4160
 
4161
+ export class Runs extends HeyApiClient {
4162
+ /**
4163
+ * List Task Runs
4164
+ *
4165
+ * This task's runs, newest first, each with its output, trace and cost.
4166
+ *
4167
+ * `task_version` says which published definition each one ran, and is null for
4168
+ * a run of the draft.
4169
+ */
4170
+ public list<ThrowOnError extends boolean = false>(parameters: {
4171
+ task_id: string;
4172
+ limit?: number;
4173
+ offset?: number;
4174
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksRunsListResults, TasksRunsListErrors, ThrowOnError, 'data'> {
4175
+ const params = buildClientParams([parameters], [{ args: [
4176
+ { in: 'path', key: 'task_id' },
4177
+ { in: 'query', key: 'limit' },
4178
+ { in: 'query', key: 'offset' }
4179
+ ] }]);
4180
+ return (options?.client ?? this.client).get<TasksRunsListResults, TasksRunsListErrors, ThrowOnError, 'data'>({
4181
+ responseStyle: 'data',
4182
+ security: [{ scheme: 'bearer', type: 'http' }, {
4183
+ in: 'cookie',
4184
+ name: 'talqing_session',
4185
+ type: 'apiKey'
4186
+ }],
4187
+ url: '/v1/tasks/{task_id}/runs',
4188
+ ...options,
4189
+ ...params
4190
+ });
4191
+ }
4192
+
4193
+ /**
4194
+ * Run Task
4195
+ *
4196
+ * Run the task once with the variables you supply, and wait for the result.
4197
+ *
4198
+ * **This executes for real**: the tools call your endpoints with your secrets,
4199
+ * the MCP servers spend your credits, and the model spends your tokens. A task
4200
+ * that books a slot, charges a card or sends a message will do so.
4201
+ *
4202
+ * Runs the published version unless `version` names another one, or `"draft"`
4203
+ * to run the unpublished config. `vars` must match what that version declares
4204
+ * — an unknown name is refused rather than dropped. The response is the whole
4205
+ * run: the structured `output`, a `trace` of every tool call, the steps used
4206
+ * and what the tokens cost. On failure `error.type` says whose problem it is.
4207
+ * Secrets are redacted.
4208
+ */
4209
+ public create<ThrowOnError extends boolean = false>(parameters: {
4210
+ task_id: string;
4211
+ runTaskRequest: RunTaskRequest;
4212
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksRunsCreateResults, TasksRunsCreateErrors, ThrowOnError, 'data'> {
4213
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'runTaskRequest', map: 'body' }] }]);
4214
+ return (options?.client ?? this.client).post<TasksRunsCreateResults, TasksRunsCreateErrors, ThrowOnError, 'data'>({
4215
+ responseStyle: 'data',
4216
+ security: [{ scheme: 'bearer', type: 'http' }, {
4217
+ in: 'cookie',
4218
+ name: 'talqing_session',
4219
+ type: 'apiKey'
4220
+ }],
4221
+ url: '/v1/tasks/{task_id}/runs',
4222
+ ...options,
4223
+ ...params,
4224
+ headers: {
4225
+ 'Content-Type': 'application/json',
4226
+ ...options?.headers,
4227
+ ...params.headers
4228
+ }
4229
+ });
4230
+ }
4231
+
4232
+ /**
4233
+ * Get Task Run
4234
+ *
4235
+ * One run in full: what it produced, every tool it called on the way, and
4236
+ * what it cost.
4237
+ *
4238
+ * This is what answers "why did it write that" for a caller holding one run id
4239
+ * — an email batch's review table links each drafted row here. Secret values
4240
+ * are redacted from the trace, and a trace that was cut reports it.
4241
+ */
4242
+ public get<ThrowOnError extends boolean = false>(parameters: {
4243
+ task_id: string;
4244
+ run_id: string;
4245
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksRunsGetResults, TasksRunsGetErrors, ThrowOnError, 'data'> {
4246
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'run_id' }] }]);
4247
+ return (options?.client ?? this.client).get<TasksRunsGetResults, TasksRunsGetErrors, ThrowOnError, 'data'>({
4248
+ responseStyle: 'data',
4249
+ security: [{ scheme: 'bearer', type: 'http' }, {
4250
+ in: 'cookie',
4251
+ name: 'talqing_session',
4252
+ type: 'apiKey'
4253
+ }],
4254
+ url: '/v1/tasks/{task_id}/runs/{run_id}',
4255
+ ...options,
4256
+ ...params
4257
+ });
4258
+ }
4259
+ }
4260
+
4054
4261
  export class Versions2 extends HeyApiClient {
4262
+ /**
4263
+ * Get Task Version
4264
+ *
4265
+ * Fetch what one published version of a task actually contains.
4266
+ *
4267
+ * `get_task` lists the versions and when each was published; this returns the
4268
+ * frozen definition itself — prompt, model, output fields and the tool
4269
+ * versions it pinned, exactly as they were at that publish.
4270
+ */
4271
+ public get<ThrowOnError extends boolean = false>(parameters: {
4272
+ task_id: string;
4273
+ version: number;
4274
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksVersionsGetResults, TasksVersionsGetErrors, ThrowOnError, 'data'> {
4275
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'version' }] }]);
4276
+ return (options?.client ?? this.client).get<TasksVersionsGetResults, TasksVersionsGetErrors, ThrowOnError, 'data'>({
4277
+ responseStyle: 'data',
4278
+ security: [{ scheme: 'bearer', type: 'http' }, {
4279
+ in: 'cookie',
4280
+ name: 'talqing_session',
4281
+ type: 'apiKey'
4282
+ }],
4283
+ url: '/v1/tasks/{task_id}/versions/{version}',
4284
+ ...options,
4285
+ ...params
4286
+ });
4287
+ }
4288
+
4289
+ /**
4290
+ * Rollback Task Version
4291
+ *
4292
+ * Put an earlier published version of a task back into production.
4293
+ *
4294
+ * That version becomes live **immediately** and **replaces the current draft**,
4295
+ * so any unpublished edits are lost. No new version is created. The restored
4296
+ * draft tracks each tool's latest published version, not the ones this version
4297
+ * pinned.
4298
+ */
4299
+ public rollback<ThrowOnError extends boolean = false>(parameters: {
4300
+ task_id: string;
4301
+ version: number;
4302
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksVersionsRollbackResults, TasksVersionsRollbackErrors, ThrowOnError, 'data'> {
4303
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'version' }] }]);
4304
+ return (options?.client ?? this.client).post<TasksVersionsRollbackResults, TasksVersionsRollbackErrors, ThrowOnError, 'data'>({
4305
+ responseStyle: 'data',
4306
+ security: [{ scheme: 'bearer', type: 'http' }, {
4307
+ in: 'cookie',
4308
+ name: 'talqing_session',
4309
+ type: 'apiKey'
4310
+ }],
4311
+ url: '/v1/tasks/{task_id}/versions/{version}/rollback',
4312
+ ...options,
4313
+ ...params
4314
+ });
4315
+ }
4316
+ }
4317
+
4318
+ export class Tasks2 extends HeyApiClient {
4319
+ /**
4320
+ * List Tasks
4321
+ *
4322
+ * List the workspace's agent tasks.
4323
+ *
4324
+ * A task is an agent nobody talks to: a prompt, one LLM, tools and MCP
4325
+ * servers, the variables it takes as input, and the typed result it must
4326
+ * produce. Each item carries the full draft config, the published version
4327
+ * number (null while it has never been published), and `last_run`.
4328
+ */
4329
+ public list<ThrowOnError extends boolean = false>(parameters?: {
4330
+ limit?: number;
4331
+ offset?: number;
4332
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksListResults, TasksListErrors, ThrowOnError, 'data'> {
4333
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
4334
+ return (options?.client ?? this.client).get<TasksListResults, TasksListErrors, ThrowOnError, 'data'>({
4335
+ responseStyle: 'data',
4336
+ security: [{ scheme: 'bearer', type: 'http' }, {
4337
+ in: 'cookie',
4338
+ name: 'talqing_session',
4339
+ type: 'apiKey'
4340
+ }],
4341
+ url: '/v1/tasks',
4342
+ ...options,
4343
+ ...params
4344
+ });
4345
+ }
4346
+
4347
+ /**
4348
+ * Create Task
4349
+ *
4350
+ * Create an agent task: an agent nobody talks to, which takes named inputs
4351
+ * and returns a typed result.
4352
+ *
4353
+ * `output` is what makes this a task rather than a chat agent — declare the
4354
+ * fields the model must produce and it is given a `submit_result` tool built
4355
+ * from them. `vars` are its inputs, read as `{{vars.name}}`. The task starts
4356
+ * unpublished; publish it before running it.
4357
+ */
4358
+ public create<ThrowOnError extends boolean = false>(parameters: {
4359
+ createTaskRequest: CreateTaskRequest;
4360
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksCreateResults, TasksCreateErrors, ThrowOnError, 'data'> {
4361
+ const params = buildClientParams([parameters], [{ args: [{ key: 'createTaskRequest', map: 'body' }] }]);
4362
+ return (options?.client ?? this.client).post<TasksCreateResults, TasksCreateErrors, ThrowOnError, 'data'>({
4363
+ responseStyle: 'data',
4364
+ security: [{ scheme: 'bearer', type: 'http' }, {
4365
+ in: 'cookie',
4366
+ name: 'talqing_session',
4367
+ type: 'apiKey'
4368
+ }],
4369
+ url: '/v1/tasks',
4370
+ ...options,
4371
+ ...params,
4372
+ headers: {
4373
+ 'Content-Type': 'application/json',
4374
+ ...options?.headers,
4375
+ ...params.headers
4376
+ }
4377
+ });
4378
+ }
4379
+
4380
+ /**
4381
+ * Delete Task
4382
+ *
4383
+ * Delete a task and its published versions. Its runs survive, still named
4384
+ * after it.
4385
+ */
4386
+ public delete<ThrowOnError extends boolean = false>(parameters: {
4387
+ task_id: string;
4388
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksDeleteResults, TasksDeleteErrors, ThrowOnError, 'data'> {
4389
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
4390
+ return (options?.client ?? this.client).delete<TasksDeleteResults, TasksDeleteErrors, ThrowOnError, 'data'>({
4391
+ responseStyle: 'data',
4392
+ security: [{ scheme: 'bearer', type: 'http' }, {
4393
+ in: 'cookie',
4394
+ name: 'talqing_session',
4395
+ type: 'apiKey'
4396
+ }],
4397
+ url: '/v1/tasks/{task_id}',
4398
+ ...options,
4399
+ ...params
4400
+ });
4401
+ }
4402
+
4403
+ /**
4404
+ * Get Task
4405
+ *
4406
+ * Fetch one task's draft config, published version, history and last run.
4407
+ */
4408
+ public get<ThrowOnError extends boolean = false>(parameters: {
4409
+ task_id: string;
4410
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksGetResults, TasksGetErrors, ThrowOnError, 'data'> {
4411
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
4412
+ return (options?.client ?? this.client).get<TasksGetResults, TasksGetErrors, ThrowOnError, 'data'>({
4413
+ responseStyle: 'data',
4414
+ security: [{ scheme: 'bearer', type: 'http' }, {
4415
+ in: 'cookie',
4416
+ name: 'talqing_session',
4417
+ type: 'apiKey'
4418
+ }],
4419
+ url: '/v1/tasks/{task_id}',
4420
+ ...options,
4421
+ ...params
4422
+ });
4423
+ }
4424
+
4425
+ /**
4426
+ * Update Task
4427
+ *
4428
+ * Replace the task's draft config with the one supplied.
4429
+ *
4430
+ * The whole config is sent, so include every field you mean to keep. Writes
4431
+ * land on the draft only — runs and email batches keep using the published
4432
+ * version until you publish again.
4433
+ */
4434
+ public update<ThrowOnError extends boolean = false>(parameters: {
4435
+ task_id: string;
4436
+ patchTaskRequest: PatchTaskRequest;
4437
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksUpdateResults, TasksUpdateErrors, ThrowOnError, 'data'> {
4438
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'patchTaskRequest', map: 'body' }] }]);
4439
+ return (options?.client ?? this.client).patch<TasksUpdateResults, TasksUpdateErrors, ThrowOnError, 'data'>({
4440
+ responseStyle: 'data',
4441
+ security: [{ scheme: 'bearer', type: 'http' }, {
4442
+ in: 'cookie',
4443
+ name: 'talqing_session',
4444
+ type: 'apiKey'
4445
+ }],
4446
+ url: '/v1/tasks/{task_id}',
4447
+ ...options,
4448
+ ...params,
4449
+ headers: {
4450
+ 'Content-Type': 'application/json',
4451
+ ...options?.headers,
4452
+ ...params.headers
4453
+ }
4454
+ });
4455
+ }
4456
+
4457
+ /**
4458
+ * Publish Task
4459
+ *
4460
+ * Freeze the current draft as a new immutable version and make it live.
4461
+ *
4462
+ * Validation must pass. Publishing pins every attached tool to the tool
4463
+ * version live right now, so republishing a tool does not change this task
4464
+ * until the task is published again.
4465
+ */
4466
+ public publish<ThrowOnError extends boolean = false>(parameters: {
4467
+ task_id: string;
4468
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksPublishResults, TasksPublishErrors, ThrowOnError, 'data'> {
4469
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
4470
+ return (options?.client ?? this.client).post<TasksPublishResults, TasksPublishErrors, ThrowOnError, 'data'>({
4471
+ responseStyle: 'data',
4472
+ security: [{ scheme: 'bearer', type: 'http' }, {
4473
+ in: 'cookie',
4474
+ name: 'talqing_session',
4475
+ type: 'apiKey'
4476
+ }],
4477
+ url: '/v1/tasks/{task_id}/publish',
4478
+ ...options,
4479
+ ...params
4480
+ });
4481
+ }
4482
+
4483
+ /**
4484
+ * Validate Task
4485
+ *
4486
+ * Run publish-grade validation on the draft without publishing it.
4487
+ *
4488
+ * Covers everything a draft write checks plus what publishing adds: a
4489
+ * workspace API key for the model, at least one output field, the operation
4490
+ * trees of the attached tools, and the email batches already drafting with
4491
+ * this task. Returns errors (blocking) and warnings (advisory).
4492
+ */
4493
+ public validate<ThrowOnError extends boolean = false>(parameters: {
4494
+ task_id: string;
4495
+ }, options?: Options<never, ThrowOnError>): RequestResult<TasksValidateResults, TasksValidateErrors, ThrowOnError, 'data'> {
4496
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
4497
+ return (options?.client ?? this.client).post<TasksValidateResults, TasksValidateErrors, ThrowOnError, 'data'>({
4498
+ responseStyle: 'data',
4499
+ security: [{ scheme: 'bearer', type: 'http' }, {
4500
+ in: 'cookie',
4501
+ name: 'talqing_session',
4502
+ type: 'apiKey'
4503
+ }],
4504
+ url: '/v1/tasks/{task_id}/validate',
4505
+ ...options,
4506
+ ...params
4507
+ });
4508
+ }
4509
+
4510
+ private _runs?: Runs;
4511
+ get runs(): Runs {
4512
+ return this._runs ??= new Runs({ client: this.client });
4513
+ }
4514
+
4515
+ private _versions?: Versions2;
4516
+ get versions(): Versions2 {
4517
+ return this._versions ??= new Versions2({ client: this.client });
4518
+ }
4519
+ }
4520
+
4521
+ export class Versions3 extends HeyApiClient {
4055
4522
  /**
4056
4523
  * Get Tool Version
4057
4524
  *
@@ -4342,9 +4809,9 @@ export class Tools2 extends HeyApiClient {
4342
4809
  });
4343
4810
  }
4344
4811
 
4345
- private _versions?: Versions2;
4346
- get versions(): Versions2 {
4347
- return this._versions ??= new Versions2({ client: this.client });
4812
+ private _versions?: Versions3;
4813
+ get versions(): Versions3 {
4814
+ return this._versions ??= new Versions3({ client: this.client });
4348
4815
  }
4349
4816
  }
4350
4817
 
@@ -4568,7 +5035,9 @@ export class TalqingApi extends HeyApiClient {
4568
5035
  * Liveness probe: `200` once this process is serving. Unauthenticated.
4569
5036
  *
4570
5037
  * It answers for the API process, not its dependencies — a `200` here does
4571
- * not promise Postgres, Redis or LiveKit are reachable.
5038
+ * not promise Postgres, Redis or LiveKit are reachable. The one thing it
5039
+ * does report is `model_registry`, because that snapshot lives in this
5040
+ * process's memory and nothing else can see how old it is.
4572
5041
  */
4573
5042
  public health<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<HealthResults, HealthErrors, ThrowOnError, 'data'> {
4574
5043
  return (options?.client ?? this.client).get<HealthResults, HealthErrors, ThrowOnError, 'data'>({
@@ -4643,16 +5112,16 @@ export class TalqingApi extends HeyApiClient {
4643
5112
  return this._secrets ??= new Secrets({ client: this.client });
4644
5113
  }
4645
5114
 
4646
- private _tasks?: Tasks2;
4647
- get tasks(): Tasks2 {
4648
- return this._tasks ??= new Tasks2({ client: this.client });
4649
- }
4650
-
4651
5115
  private _telephony?: Telephony;
4652
5116
  get telephony(): Telephony {
4653
5117
  return this._telephony ??= new Telephony({ client: this.client });
4654
5118
  }
4655
5119
 
5120
+ private _tasks?: Tasks2;
5121
+ get tasks(): Tasks2 {
5122
+ return this._tasks ??= new Tasks2({ client: this.client });
5123
+ }
5124
+
4656
5125
  private _tools?: Tools2;
4657
5126
  get tools(): Tools2 {
4658
5127
  return this._tools ??= new Tools2({ client: this.client });