@talqing/sdk 0.4.1 → 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.
@@ -1077,6 +1077,36 @@ export class Avatars extends HeyApiClient {
1077
1077
  });
1078
1078
  }
1079
1079
  }
1080
+ export class Models extends HeyApiClient {
1081
+ /**
1082
+ * Search Models
1083
+ *
1084
+ * Search the language models a provider offers too many of to list.
1085
+ *
1086
+ * `GET /catalog` carries every model except these. A provider marked
1087
+ * `browse: "search"` there — OpenRouter — reaches hundreds of models through
1088
+ * one key, so they are searched a page at a time instead. With no `q` the order
1089
+ * is real-world popularity. Everything returned is a valid `llm.model`.
1090
+ */
1091
+ search(parameters, options) {
1092
+ const params = buildClientParams([parameters], [{ args: [
1093
+ { in: 'query', key: 'q' },
1094
+ { in: 'query', key: 'limit' },
1095
+ { in: 'query', key: 'cursor' }
1096
+ ] }]);
1097
+ return (options?.client ?? this.client).get({
1098
+ responseStyle: 'data',
1099
+ security: [{ scheme: 'bearer', type: 'http' }, {
1100
+ in: 'cookie',
1101
+ name: 'talqing_session',
1102
+ type: 'apiKey'
1103
+ }],
1104
+ url: '/v1/catalog/models',
1105
+ ...options,
1106
+ ...params
1107
+ });
1108
+ }
1109
+ }
1080
1110
  export class Elevenlabs extends HeyApiClient {
1081
1111
  /**
1082
1112
  * Add Elevenlabs Voice
@@ -1190,6 +1220,10 @@ export class Catalog extends HeyApiClient {
1190
1220
  * `realtime` lists the speech-to-speech models. One of those replaces `stt`,
1191
1221
  * `llm` and `tts` together, so an agent sets either `realtime` or the three
1192
1222
  * cascade slots, never both.
1223
+ *
1224
+ * One provider's models are NOT here: a `providers` entry whose `browse` is
1225
+ * `search` reaches hundreds of them through one key, and they are searched
1226
+ * through `GET /catalog/models` instead.
1193
1227
  */
1194
1228
  get(options) {
1195
1229
  return (options?.client ?? this.client).get({
@@ -1206,6 +1240,9 @@ export class Catalog extends HeyApiClient {
1206
1240
  get avatars() {
1207
1241
  return this._avatars ?? (this._avatars = new Avatars({ client: this.client }));
1208
1242
  }
1243
+ get models() {
1244
+ return this._models ?? (this._models = new Models({ client: this.client }));
1245
+ }
1209
1246
  get voices() {
1210
1247
  return this._voices ?? (this._voices = new Voices({ client: this.client }));
1211
1248
  }
@@ -1777,7 +1814,8 @@ export class Recipients2 extends HeyApiClient {
1777
1814
  * every row it refuses. Rows already sent or queued are never redrafted.
1778
1815
  *
1779
1816
  * This revives a batch that had finished drafting, and a person's edited cells
1780
- * survive unless you pass `clear_overrides`.
1817
+ * survive unless you pass `clear_overrides` — and are what the task is given.
1818
+ * Refused on a canceled batch, whose rows can never draft again.
1781
1819
  */
1782
1820
  redraft(parameters, options) {
1783
1821
  const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'redraftRequest', map: 'body' }] }]);
@@ -1825,11 +1863,10 @@ export class Recipients2 extends HeyApiClient {
1825
1863
  /**
1826
1864
  * Skip Email Batch Recipients
1827
1865
  *
1828
- * Take drafted rows out of consideration. Reversible with `restore`.
1866
+ * Take rows out of consideration. Reversible with `restore`.
1829
1867
  *
1830
- * Takes either `recipient_ids` or `selection: "all_eligible"`, which here means
1831
- * every row that has a draft. The reversible verbs keep that shorthand while
1832
- * `send` does not, because the rule is about irreversibility rather than bulk.
1868
+ * Accepts drafted rows and rows whose drafting failed. Takes either
1869
+ * `recipient_ids` or `selection: "all_eligible"`, which here means both.
1833
1870
  */
1834
1871
  skip(parameters, options) {
1835
1872
  const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
@@ -1913,8 +1950,8 @@ export class Sends extends HeyApiClient {
1913
1950
  *
1914
1951
  * One send: where its rows are, and when it next does something.
1915
1952
  *
1916
- * `next_send_at` covers all three reasons a send waits a start time, a closed
1917
- * window, and a daily cap already spent.
1953
+ * `next_send_reason` says which gate is holding it`start`, `window`,
1954
+ * `daily_cap`, `retry` or `gap`.
1918
1955
  */
1919
1956
  get(parameters, options) {
1920
1957
  const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { in: 'path', key: 'send_id' }] }]);
@@ -3036,152 +3073,11 @@ export class Secrets extends HeyApiClient {
3036
3073
  });
3037
3074
  }
3038
3075
  }
3039
- export class Runs extends HeyApiClient {
3040
- /**
3041
- * List Task Runs
3042
- *
3043
- * This task's runs, newest first, each with its output, trace and cost.
3044
- *
3045
- * `task_version` says which published definition each one ran, and is null for
3046
- * a run of the draft.
3047
- */
3048
- list(parameters, options) {
3049
- const params = buildClientParams([parameters], [{ args: [
3050
- { in: 'path', key: 'task_id' },
3051
- { in: 'query', key: 'limit' },
3052
- { in: 'query', key: 'offset' }
3053
- ] }]);
3054
- return (options?.client ?? this.client).get({
3055
- responseStyle: 'data',
3056
- security: [{ scheme: 'bearer', type: 'http' }, {
3057
- in: 'cookie',
3058
- name: 'talqing_session',
3059
- type: 'apiKey'
3060
- }],
3061
- url: '/v1/tasks/{task_id}/runs',
3062
- ...options,
3063
- ...params
3064
- });
3065
- }
3066
- /**
3067
- * Run Task
3068
- *
3069
- * Run the task once with the variables you supply, and wait for the result.
3070
- *
3071
- * **This executes for real**: the tools call your endpoints with your secrets,
3072
- * the MCP servers spend your credits, and the model spends your tokens. A task
3073
- * that books a slot, charges a card or sends a message will do so.
3074
- *
3075
- * Runs the published version unless `version` names another one, or `"draft"`
3076
- * to run the unpublished config. `vars` must match what that version declares
3077
- * — an unknown name is refused rather than dropped. The response is the whole
3078
- * run: the structured `output`, a `trace` of every tool call, the steps used
3079
- * and what the tokens cost. On failure `error.type` says whose problem it is.
3080
- * Secrets are redacted.
3081
- */
3082
- create(parameters, options) {
3083
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'runTaskRequest', map: 'body' }] }]);
3084
- return (options?.client ?? this.client).post({
3085
- responseStyle: 'data',
3086
- security: [{ scheme: 'bearer', type: 'http' }, {
3087
- in: 'cookie',
3088
- name: 'talqing_session',
3089
- type: 'apiKey'
3090
- }],
3091
- url: '/v1/tasks/{task_id}/runs',
3092
- ...options,
3093
- ...params,
3094
- headers: {
3095
- 'Content-Type': 'application/json',
3096
- ...options?.headers,
3097
- ...params.headers
3098
- }
3099
- });
3100
- }
3101
- /**
3102
- * Get Task Run
3103
- *
3104
- * One run in full: what it produced, every tool it called on the way, and
3105
- * what it cost.
3106
- *
3107
- * This is what answers "why did it write that" for a caller holding one run id
3108
- * — an email batch's review table links each drafted row here. Secret values
3109
- * are redacted from the trace, and a trace that was cut reports it.
3110
- */
3111
- get(parameters, options) {
3112
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'run_id' }] }]);
3113
- return (options?.client ?? this.client).get({
3114
- responseStyle: 'data',
3115
- security: [{ scheme: 'bearer', type: 'http' }, {
3116
- in: 'cookie',
3117
- name: 'talqing_session',
3118
- type: 'apiKey'
3119
- }],
3120
- url: '/v1/tasks/{task_id}/runs/{run_id}',
3121
- ...options,
3122
- ...params
3123
- });
3124
- }
3125
- }
3126
- export class Versions2 extends HeyApiClient {
3127
- /**
3128
- * Get Task Version
3129
- *
3130
- * Fetch what one published version of a task actually contains.
3131
- *
3132
- * `get_task` lists the versions and when each was published; this returns the
3133
- * frozen definition itself — prompt, model, output fields and the tool
3134
- * versions it pinned, exactly as they were at that publish.
3135
- */
3136
- get(parameters, options) {
3137
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'version' }] }]);
3138
- return (options?.client ?? this.client).get({
3139
- responseStyle: 'data',
3140
- security: [{ scheme: 'bearer', type: 'http' }, {
3141
- in: 'cookie',
3142
- name: 'talqing_session',
3143
- type: 'apiKey'
3144
- }],
3145
- url: '/v1/tasks/{task_id}/versions/{version}',
3146
- ...options,
3147
- ...params
3148
- });
3149
- }
3150
- /**
3151
- * Rollback Task Version
3152
- *
3153
- * Put an earlier published version of a task back into production.
3154
- *
3155
- * That version becomes live **immediately** and **replaces the current draft**,
3156
- * so any unpublished edits are lost. No new version is created. The restored
3157
- * draft tracks each tool's latest published version, not the ones this version
3158
- * pinned.
3159
- */
3160
- rollback(parameters, options) {
3161
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'version' }] }]);
3162
- return (options?.client ?? this.client).post({
3163
- responseStyle: 'data',
3164
- security: [{ scheme: 'bearer', type: 'http' }, {
3165
- in: 'cookie',
3166
- name: 'talqing_session',
3167
- type: 'apiKey'
3168
- }],
3169
- url: '/v1/tasks/{task_id}/versions/{version}/rollback',
3170
- ...options,
3171
- ...params
3172
- });
3173
- }
3174
- }
3175
- export class Tasks2 extends HeyApiClient {
3076
+ export class Streams extends HeyApiClient {
3176
3077
  /**
3177
- * List Tasks
3178
- *
3179
- * List the workspace's agent tasks.
3078
+ * List Stream Connections
3180
3079
  *
3181
- * A task is an agent nobody talks to: a prompt, one LLM, tools and MCP
3182
- * servers, the variables it takes as input, and the typed result it must
3183
- * produce. Each item carries the full draft config, the published version
3184
- * number (null while it has never been published), and `last_run`.
3080
+ * List WebSocket media-stream connections a partner can dial.
3185
3081
  */
3186
3082
  list(parameters, options) {
3187
3083
  const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
@@ -3192,24 +3088,21 @@ export class Tasks2 extends HeyApiClient {
3192
3088
  name: 'talqing_session',
3193
3089
  type: 'apiKey'
3194
3090
  }],
3195
- url: '/v1/tasks',
3091
+ url: '/v1/streams',
3196
3092
  ...options,
3197
3093
  ...params
3198
3094
  });
3199
3095
  }
3200
3096
  /**
3201
- * Create Task
3097
+ * Create Stream Connection
3202
3098
  *
3203
- * Create an agent task: an agent nobody talks to, which takes named inputs
3204
- * and returns a typed result.
3099
+ * Create a connection a streaming partner can dial.
3205
3100
  *
3206
- * `output` is what makes this a task rather than a chat agent declare the
3207
- * fields the model must produce and it is given a `submit_result` tool built
3208
- * from them. `vars` are its inputs, read as `{{vars.name}}`. The task starts
3209
- * unpublished; publish it before running it.
3101
+ * One connection per agent per dialect: the URL names both, so a second would
3102
+ * only be the same URL again.
3210
3103
  */
3211
3104
  create(parameters, options) {
3212
- const params = buildClientParams([parameters], [{ args: [{ key: 'createTaskRequest', map: 'body' }] }]);
3105
+ const params = buildClientParams([parameters], [{ args: [{ key: 'createStreamConnectionRequest', map: 'body' }] }]);
3213
3106
  return (options?.client ?? this.client).post({
3214
3107
  responseStyle: 'data',
3215
3108
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -3217,7 +3110,7 @@ export class Tasks2 extends HeyApiClient {
3217
3110
  name: 'talqing_session',
3218
3111
  type: 'apiKey'
3219
3112
  }],
3220
- url: '/v1/tasks',
3113
+ url: '/v1/streams',
3221
3114
  ...options,
3222
3115
  ...params,
3223
3116
  headers: {
@@ -3228,13 +3121,12 @@ export class Tasks2 extends HeyApiClient {
3228
3121
  });
3229
3122
  }
3230
3123
  /**
3231
- * Delete Task
3124
+ * Delete Stream Connection
3232
3125
  *
3233
- * Delete a task and its published versions. Its runs survive, still named
3234
- * after it.
3126
+ * Delete a stream connection. Calls it already carried are kept.
3235
3127
  */
3236
3128
  delete(parameters, options) {
3237
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3129
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'connection_id' }] }]);
3238
3130
  return (options?.client ?? this.client).delete({
3239
3131
  responseStyle: 'data',
3240
3132
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -3242,18 +3134,18 @@ export class Tasks2 extends HeyApiClient {
3242
3134
  name: 'talqing_session',
3243
3135
  type: 'apiKey'
3244
3136
  }],
3245
- url: '/v1/tasks/{task_id}',
3137
+ url: '/v1/streams/{connection_id}',
3246
3138
  ...options,
3247
3139
  ...params
3248
3140
  });
3249
3141
  }
3250
3142
  /**
3251
- * Get Task
3143
+ * Get Stream Connection
3252
3144
  *
3253
- * Fetch one task's draft config, published version, history and last run.
3145
+ * One stream connection, with the URL to hand the partner.
3254
3146
  */
3255
3147
  get(parameters, options) {
3256
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3148
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'connection_id' }] }]);
3257
3149
  return (options?.client ?? this.client).get({
3258
3150
  responseStyle: 'data',
3259
3151
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -3261,22 +3153,21 @@ export class Tasks2 extends HeyApiClient {
3261
3153
  name: 'talqing_session',
3262
3154
  type: 'apiKey'
3263
3155
  }],
3264
- url: '/v1/tasks/{task_id}',
3156
+ url: '/v1/streams/{connection_id}',
3265
3157
  ...options,
3266
3158
  ...params
3267
3159
  });
3268
3160
  }
3269
3161
  /**
3270
- * Update Task
3162
+ * Patch Stream Connection
3271
3163
  *
3272
- * Replace the task's draft config with the one supplied.
3164
+ * Rename a connection, point it at another agent, or disable it.
3273
3165
  *
3274
- * The whole config is sent, so include every field you mean to keep. Writes
3275
- * land on the draft only — runs and email batches keep using the published
3276
- * version until you publish again.
3166
+ * Disabling refuses new calls immediately and is the only way to stop a URL
3167
+ * answering; calls already running are untouched.
3277
3168
  */
3278
3169
  update(parameters, options) {
3279
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'patchTaskRequest', map: 'body' }] }]);
3170
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'connection_id' }, { key: 'patchStreamConnectionRequest', map: 'body' }] }]);
3280
3171
  return (options?.client ?? this.client).patch({
3281
3172
  responseStyle: 'data',
3282
3173
  security: [{ scheme: 'bearer', type: 'http' }, {
@@ -3284,7 +3175,7 @@ export class Tasks2 extends HeyApiClient {
3284
3175
  name: 'talqing_session',
3285
3176
  type: 'apiKey'
3286
3177
  }],
3287
- url: '/v1/tasks/{task_id}',
3178
+ url: '/v1/streams/{connection_id}',
3288
3179
  ...options,
3289
3180
  ...params,
3290
3181
  headers: {
@@ -3294,59 +3185,6 @@ export class Tasks2 extends HeyApiClient {
3294
3185
  }
3295
3186
  });
3296
3187
  }
3297
- /**
3298
- * Publish Task
3299
- *
3300
- * Freeze the current draft as a new immutable version and make it live.
3301
- *
3302
- * Validation must pass. Publishing pins every attached tool to the tool
3303
- * version live right now, so republishing a tool does not change this task
3304
- * until the task is published again.
3305
- */
3306
- publish(parameters, options) {
3307
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3308
- return (options?.client ?? this.client).post({
3309
- responseStyle: 'data',
3310
- security: [{ scheme: 'bearer', type: 'http' }, {
3311
- in: 'cookie',
3312
- name: 'talqing_session',
3313
- type: 'apiKey'
3314
- }],
3315
- url: '/v1/tasks/{task_id}/publish',
3316
- ...options,
3317
- ...params
3318
- });
3319
- }
3320
- /**
3321
- * Validate Task
3322
- *
3323
- * Run publish-grade validation on the draft without publishing it.
3324
- *
3325
- * Covers everything a draft write checks plus what publishing adds: a
3326
- * workspace API key for the model, at least one output field, the operation
3327
- * trees of the attached tools, and the email batches already drafting with
3328
- * this task. Returns errors (blocking) and warnings (advisory).
3329
- */
3330
- validate(parameters, options) {
3331
- const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3332
- return (options?.client ?? this.client).post({
3333
- responseStyle: 'data',
3334
- security: [{ scheme: 'bearer', type: 'http' }, {
3335
- in: 'cookie',
3336
- name: 'talqing_session',
3337
- type: 'apiKey'
3338
- }],
3339
- url: '/v1/tasks/{task_id}/validate',
3340
- ...options,
3341
- ...params
3342
- });
3343
- }
3344
- get runs() {
3345
- return this._runs ?? (this._runs = new Runs({ client: this.client }));
3346
- }
3347
- get versions() {
3348
- return this._versions ?? (this._versions = new Versions2({ client: this.client }));
3349
- }
3350
3188
  }
3351
3189
  export class Accounts extends HeyApiClient {
3352
3190
  /**
@@ -3738,6 +3576,9 @@ export class Providers extends HeyApiClient {
3738
3576
  }
3739
3577
  }
3740
3578
  export class Telephony extends HeyApiClient {
3579
+ get streams() {
3580
+ return this._streams ?? (this._streams = new Streams({ client: this.client }));
3581
+ }
3741
3582
  get accounts() {
3742
3583
  return this._accounts ?? (this._accounts = new Accounts({ client: this.client }));
3743
3584
  }
@@ -3748,17 +3589,329 @@ export class Telephony extends HeyApiClient {
3748
3589
  return this._providers ?? (this._providers = new Providers({ client: this.client }));
3749
3590
  }
3750
3591
  }
3751
- export class Versions3 extends HeyApiClient {
3592
+ export class Runs extends HeyApiClient {
3752
3593
  /**
3753
- * Get Tool Version
3594
+ * List Task Runs
3754
3595
  *
3755
- * Fetch what one published version of a tool actually contains.
3596
+ * This task's runs, newest first, each with its output, trace and cost.
3756
3597
  *
3757
- * `get_tool` lists the versions and when each was published; this returns the
3758
- * frozen definition itself the arguments, behaviour flags and operation tree
3759
- * exactly as they were at that publish. Use it to see what changed between two
3760
- * versions, or between a version and the current draft.
3761
- */
3598
+ * `task_version` says which published definition each one ran, and is null for
3599
+ * a run of the draft.
3600
+ */
3601
+ list(parameters, options) {
3602
+ const params = buildClientParams([parameters], [{ args: [
3603
+ { in: 'path', key: 'task_id' },
3604
+ { in: 'query', key: 'limit' },
3605
+ { in: 'query', key: 'offset' }
3606
+ ] }]);
3607
+ return (options?.client ?? this.client).get({
3608
+ responseStyle: 'data',
3609
+ security: [{ scheme: 'bearer', type: 'http' }, {
3610
+ in: 'cookie',
3611
+ name: 'talqing_session',
3612
+ type: 'apiKey'
3613
+ }],
3614
+ url: '/v1/tasks/{task_id}/runs',
3615
+ ...options,
3616
+ ...params
3617
+ });
3618
+ }
3619
+ /**
3620
+ * Run Task
3621
+ *
3622
+ * Run the task once with the variables you supply, and wait for the result.
3623
+ *
3624
+ * **This executes for real**: the tools call your endpoints with your secrets,
3625
+ * the MCP servers spend your credits, and the model spends your tokens. A task
3626
+ * that books a slot, charges a card or sends a message will do so.
3627
+ *
3628
+ * Runs the published version unless `version` names another one, or `"draft"`
3629
+ * to run the unpublished config. `vars` must match what that version declares
3630
+ * — an unknown name is refused rather than dropped. The response is the whole
3631
+ * run: the structured `output`, a `trace` of every tool call, the steps used
3632
+ * and what the tokens cost. On failure `error.type` says whose problem it is.
3633
+ * Secrets are redacted.
3634
+ */
3635
+ create(parameters, options) {
3636
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'runTaskRequest', map: 'body' }] }]);
3637
+ return (options?.client ?? this.client).post({
3638
+ responseStyle: 'data',
3639
+ security: [{ scheme: 'bearer', type: 'http' }, {
3640
+ in: 'cookie',
3641
+ name: 'talqing_session',
3642
+ type: 'apiKey'
3643
+ }],
3644
+ url: '/v1/tasks/{task_id}/runs',
3645
+ ...options,
3646
+ ...params,
3647
+ headers: {
3648
+ 'Content-Type': 'application/json',
3649
+ ...options?.headers,
3650
+ ...params.headers
3651
+ }
3652
+ });
3653
+ }
3654
+ /**
3655
+ * Get Task Run
3656
+ *
3657
+ * One run in full: what it produced, every tool it called on the way, and
3658
+ * what it cost.
3659
+ *
3660
+ * This is what answers "why did it write that" for a caller holding one run id
3661
+ * — an email batch's review table links each drafted row here. Secret values
3662
+ * are redacted from the trace, and a trace that was cut reports it.
3663
+ */
3664
+ get(parameters, options) {
3665
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'run_id' }] }]);
3666
+ return (options?.client ?? this.client).get({
3667
+ responseStyle: 'data',
3668
+ security: [{ scheme: 'bearer', type: 'http' }, {
3669
+ in: 'cookie',
3670
+ name: 'talqing_session',
3671
+ type: 'apiKey'
3672
+ }],
3673
+ url: '/v1/tasks/{task_id}/runs/{run_id}',
3674
+ ...options,
3675
+ ...params
3676
+ });
3677
+ }
3678
+ }
3679
+ export class Versions2 extends HeyApiClient {
3680
+ /**
3681
+ * Get Task Version
3682
+ *
3683
+ * Fetch what one published version of a task actually contains.
3684
+ *
3685
+ * `get_task` lists the versions and when each was published; this returns the
3686
+ * frozen definition itself — prompt, model, output fields and the tool
3687
+ * versions it pinned, exactly as they were at that publish.
3688
+ */
3689
+ get(parameters, options) {
3690
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'version' }] }]);
3691
+ return (options?.client ?? this.client).get({
3692
+ responseStyle: 'data',
3693
+ security: [{ scheme: 'bearer', type: 'http' }, {
3694
+ in: 'cookie',
3695
+ name: 'talqing_session',
3696
+ type: 'apiKey'
3697
+ }],
3698
+ url: '/v1/tasks/{task_id}/versions/{version}',
3699
+ ...options,
3700
+ ...params
3701
+ });
3702
+ }
3703
+ /**
3704
+ * Rollback Task Version
3705
+ *
3706
+ * Put an earlier published version of a task back into production.
3707
+ *
3708
+ * That version becomes live **immediately** and **replaces the current draft**,
3709
+ * so any unpublished edits are lost. No new version is created. The restored
3710
+ * draft tracks each tool's latest published version, not the ones this version
3711
+ * pinned.
3712
+ */
3713
+ rollback(parameters, options) {
3714
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'version' }] }]);
3715
+ return (options?.client ?? this.client).post({
3716
+ responseStyle: 'data',
3717
+ security: [{ scheme: 'bearer', type: 'http' }, {
3718
+ in: 'cookie',
3719
+ name: 'talqing_session',
3720
+ type: 'apiKey'
3721
+ }],
3722
+ url: '/v1/tasks/{task_id}/versions/{version}/rollback',
3723
+ ...options,
3724
+ ...params
3725
+ });
3726
+ }
3727
+ }
3728
+ export class Tasks2 extends HeyApiClient {
3729
+ /**
3730
+ * List Tasks
3731
+ *
3732
+ * List the workspace's agent tasks.
3733
+ *
3734
+ * A task is an agent nobody talks to: a prompt, one LLM, tools and MCP
3735
+ * servers, the variables it takes as input, and the typed result it must
3736
+ * produce. Each item carries the full draft config, the published version
3737
+ * number (null while it has never been published), and `last_run`.
3738
+ */
3739
+ list(parameters, options) {
3740
+ const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3741
+ return (options?.client ?? this.client).get({
3742
+ responseStyle: 'data',
3743
+ security: [{ scheme: 'bearer', type: 'http' }, {
3744
+ in: 'cookie',
3745
+ name: 'talqing_session',
3746
+ type: 'apiKey'
3747
+ }],
3748
+ url: '/v1/tasks',
3749
+ ...options,
3750
+ ...params
3751
+ });
3752
+ }
3753
+ /**
3754
+ * Create Task
3755
+ *
3756
+ * Create an agent task: an agent nobody talks to, which takes named inputs
3757
+ * and returns a typed result.
3758
+ *
3759
+ * `output` is what makes this a task rather than a chat agent — declare the
3760
+ * fields the model must produce and it is given a `submit_result` tool built
3761
+ * from them. `vars` are its inputs, read as `{{vars.name}}`. The task starts
3762
+ * unpublished; publish it before running it.
3763
+ */
3764
+ create(parameters, options) {
3765
+ const params = buildClientParams([parameters], [{ args: [{ key: 'createTaskRequest', map: 'body' }] }]);
3766
+ return (options?.client ?? this.client).post({
3767
+ responseStyle: 'data',
3768
+ security: [{ scheme: 'bearer', type: 'http' }, {
3769
+ in: 'cookie',
3770
+ name: 'talqing_session',
3771
+ type: 'apiKey'
3772
+ }],
3773
+ url: '/v1/tasks',
3774
+ ...options,
3775
+ ...params,
3776
+ headers: {
3777
+ 'Content-Type': 'application/json',
3778
+ ...options?.headers,
3779
+ ...params.headers
3780
+ }
3781
+ });
3782
+ }
3783
+ /**
3784
+ * Delete Task
3785
+ *
3786
+ * Delete a task and its published versions. Its runs survive, still named
3787
+ * after it.
3788
+ */
3789
+ delete(parameters, options) {
3790
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3791
+ return (options?.client ?? this.client).delete({
3792
+ responseStyle: 'data',
3793
+ security: [{ scheme: 'bearer', type: 'http' }, {
3794
+ in: 'cookie',
3795
+ name: 'talqing_session',
3796
+ type: 'apiKey'
3797
+ }],
3798
+ url: '/v1/tasks/{task_id}',
3799
+ ...options,
3800
+ ...params
3801
+ });
3802
+ }
3803
+ /**
3804
+ * Get Task
3805
+ *
3806
+ * Fetch one task's draft config, published version, history and last run.
3807
+ */
3808
+ get(parameters, options) {
3809
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3810
+ return (options?.client ?? this.client).get({
3811
+ responseStyle: 'data',
3812
+ security: [{ scheme: 'bearer', type: 'http' }, {
3813
+ in: 'cookie',
3814
+ name: 'talqing_session',
3815
+ type: 'apiKey'
3816
+ }],
3817
+ url: '/v1/tasks/{task_id}',
3818
+ ...options,
3819
+ ...params
3820
+ });
3821
+ }
3822
+ /**
3823
+ * Update Task
3824
+ *
3825
+ * Replace the task's draft config with the one supplied.
3826
+ *
3827
+ * The whole config is sent, so include every field you mean to keep. Writes
3828
+ * land on the draft only — runs and email batches keep using the published
3829
+ * version until you publish again.
3830
+ */
3831
+ update(parameters, options) {
3832
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'patchTaskRequest', map: 'body' }] }]);
3833
+ return (options?.client ?? this.client).patch({
3834
+ responseStyle: 'data',
3835
+ security: [{ scheme: 'bearer', type: 'http' }, {
3836
+ in: 'cookie',
3837
+ name: 'talqing_session',
3838
+ type: 'apiKey'
3839
+ }],
3840
+ url: '/v1/tasks/{task_id}',
3841
+ ...options,
3842
+ ...params,
3843
+ headers: {
3844
+ 'Content-Type': 'application/json',
3845
+ ...options?.headers,
3846
+ ...params.headers
3847
+ }
3848
+ });
3849
+ }
3850
+ /**
3851
+ * Publish Task
3852
+ *
3853
+ * Freeze the current draft as a new immutable version and make it live.
3854
+ *
3855
+ * Validation must pass. Publishing pins every attached tool to the tool
3856
+ * version live right now, so republishing a tool does not change this task
3857
+ * until the task is published again.
3858
+ */
3859
+ publish(parameters, options) {
3860
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3861
+ return (options?.client ?? this.client).post({
3862
+ responseStyle: 'data',
3863
+ security: [{ scheme: 'bearer', type: 'http' }, {
3864
+ in: 'cookie',
3865
+ name: 'talqing_session',
3866
+ type: 'apiKey'
3867
+ }],
3868
+ url: '/v1/tasks/{task_id}/publish',
3869
+ ...options,
3870
+ ...params
3871
+ });
3872
+ }
3873
+ /**
3874
+ * Validate Task
3875
+ *
3876
+ * Run publish-grade validation on the draft without publishing it.
3877
+ *
3878
+ * Covers everything a draft write checks plus what publishing adds: a
3879
+ * workspace API key for the model, at least one output field, the operation
3880
+ * trees of the attached tools, and the email batches already drafting with
3881
+ * this task. Returns errors (blocking) and warnings (advisory).
3882
+ */
3883
+ validate(parameters, options) {
3884
+ const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3885
+ return (options?.client ?? this.client).post({
3886
+ responseStyle: 'data',
3887
+ security: [{ scheme: 'bearer', type: 'http' }, {
3888
+ in: 'cookie',
3889
+ name: 'talqing_session',
3890
+ type: 'apiKey'
3891
+ }],
3892
+ url: '/v1/tasks/{task_id}/validate',
3893
+ ...options,
3894
+ ...params
3895
+ });
3896
+ }
3897
+ get runs() {
3898
+ return this._runs ?? (this._runs = new Runs({ client: this.client }));
3899
+ }
3900
+ get versions() {
3901
+ return this._versions ?? (this._versions = new Versions2({ client: this.client }));
3902
+ }
3903
+ }
3904
+ export class Versions3 extends HeyApiClient {
3905
+ /**
3906
+ * Get Tool Version
3907
+ *
3908
+ * Fetch what one published version of a tool actually contains.
3909
+ *
3910
+ * `get_tool` lists the versions and when each was published; this returns the
3911
+ * frozen definition itself — the arguments, behaviour flags and operation tree
3912
+ * exactly as they were at that publish. Use it to see what changed between two
3913
+ * versions, or between a version and the current draft.
3914
+ */
3762
3915
  get(parameters, options) {
3763
3916
  const params = buildClientParams([parameters], [{ args: [{ in: 'path', key: 'tool_id' }, { in: 'path', key: 'version' }] }]);
3764
3917
  return (options?.client ?? this.client).get({
@@ -4195,7 +4348,9 @@ export class TalqingApi extends HeyApiClient {
4195
4348
  * Liveness probe: `200` once this process is serving. Unauthenticated.
4196
4349
  *
4197
4350
  * It answers for the API process, not its dependencies — a `200` here does
4198
- * not promise Postgres, Redis or LiveKit are reachable.
4351
+ * not promise Postgres, Redis or LiveKit are reachable. The one thing it
4352
+ * does report is `model_registry`, because that snapshot lives in this
4353
+ * process's memory and nothing else can see how old it is.
4199
4354
  */
4200
4355
  health(options) {
4201
4356
  return (options?.client ?? this.client).get({
@@ -4243,12 +4398,12 @@ export class TalqingApi extends HeyApiClient {
4243
4398
  get secrets() {
4244
4399
  return this._secrets ?? (this._secrets = new Secrets({ client: this.client }));
4245
4400
  }
4246
- get tasks() {
4247
- return this._tasks ?? (this._tasks = new Tasks2({ client: this.client }));
4248
- }
4249
4401
  get telephony() {
4250
4402
  return this._telephony ?? (this._telephony = new Telephony({ client: this.client }));
4251
4403
  }
4404
+ get tasks() {
4405
+ return this._tasks ?? (this._tasks = new Tasks2({ client: this.client }));
4406
+ }
4252
4407
  get tools() {
4253
4408
  return this._tools ?? (this._tools = new Tools2({ client: this.client }));
4254
4409
  }