@vitrina/api 14.47.0 → 14.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2402,7 +2402,7 @@ interface paths {
2402
2402
  put?: never;
2403
2403
  /**
2404
2404
  * Atomically promote the draft onto the live runtime + snapshot a version
2405
- * @description Gated by Agent Evals (ADR 0098): when the agent has an ENABLED GOLDEN suite whose gate is `blocked` or `stale`, this answers **409** `{ error, code: 'evals_blocked' | 'evals_stale', gate }` — see `GET /ai-agents/{id}/publish-gate` for the semantics. `force: true` publishes anyway and is recorded in the audit log with the actor. `skip_eval: true` skips the post-publish suite/scenario run; it does NOT bypass the gate.
2405
+ * @description Publishing never runs, waits on or is blocked by Agent Evals: evals run only when someone asks for them (`POST /ai-agents/{id}/scenarios/run`). `force` and `skip_eval` are accepted for compatibility and ignored. `GET /ai-agents/{id}/publish-gate` is informational only.
2406
2406
  *
2407
2407
  * **Optimistic concurrency.** `expected_draft_version` (or `If-Match`) is the `draft_version` you reviewed: if someone staged changes since, the publish is refused with 409 `VERSION_CONFLICT` instead of shipping a draft you have not seen. A draft started on a live config that has since changed (e.g. `PUT /ai-agents/{id}/system-prompt` while it was staged) is refused with 409 `VERSION_CONFLICT` reason `draft_base_stale` — publishing it would silently overwrite that change; send `expected_config_version` equal to the current `config_version` to publish over it deliberately, or discard and restage. The response carries the new live `config_version`.
2408
2408
  */
@@ -34471,7 +34471,7 @@ interface paths {
34471
34471
  *
34472
34472
  * With `period=YYYY-MM` (a past Santiago month, #3760) the same shape describes that month: its meters over the whole month, and for the amount only what was billed — the issued cobro's frozen `lines` and `totals` with its frozen UF (`amount_source: invoice`), a month invoiced by hand (`external`) or nothing (`none`, usage only); never today's prices. A cobro that froze its billed set counts conversations from it (`conversations_source: invoice`), so the count equals the cobro's. `projection` is null for a past month. A future month is a 400.
34473
34473
  *
34474
- * `daily` carries every metric per Santiago day (conversations, voice and forwarded minutes, email-campaign sends, per-unit add-on usage); each series' `total` is the sum of its days. `GET /billing/usage/export` is the same as CSV.
34474
+ * `daily` carries every metric per Santiago day (conversations, voice and forwarded minutes, billed agent-eval runs, email-campaign sends, per-unit add-on usage); each series' `total` is the sum of its days. `GET /billing/usage/export` is the same as CSV.
34475
34475
  *
34476
34476
  * `next_charge` (current month only; null for a past month or when prices are hidden) is the cobro the close will issue: its cut-off, issue and charge dates, whether it is charged automatically or paid by transfer, and its lines in pesos (so far and at month end) exactly as the hosted cobro will show them. Counts and money only, never conversation content. Requires `billing:read`.
34477
34477
  */
@@ -34517,6 +34517,7 @@ interface paths {
34517
34517
  * "conversations": 3,
34518
34518
  * "voice_minutes": 4,
34519
34519
  * "forwarded_voice_minutes": 0,
34520
+ * "eval_runs": 0,
34520
34521
  * "email_marketable_contacts": 0,
34521
34522
  * "email_marketing_sent": 0
34522
34523
  * },
@@ -34588,6 +34589,16 @@ interface paths {
34588
34589
  * ]
34589
34590
  * },
34590
34591
  * {
34592
+ * "metric": "eval_runs",
34593
+ * "feature": null,
34594
+ * "total": 0,
34595
+ * "values": [
34596
+ * 0,
34597
+ * 0,
34598
+ * 0
34599
+ * ]
34600
+ * },
34601
+ * {
34591
34602
  * "metric": "email_marketing_sent",
34592
34603
  * "feature": null,
34593
34604
  * "total": 0,
@@ -48705,7 +48716,7 @@ interface paths {
48705
48716
  put?: never;
48706
48717
  /**
48707
48718
  * Publish the graph
48708
- * @description The only validating write on this resource, and the one with real consequences. In order: enforce the tenant `editable_window` (409 outside it); promote the draft onto the live shape, **replacing the node set wholesale** if the draft carries `nodes`; hard-validate (400 on a bad graph — and the draft has already been promoted by then); snapshot into a new `ai_agent_graph_version`; move `published_version_id`; dispatch the `ai_agent_graph.publish` webhook; and, unless `skip_eval` is set, start the graph eval suite. The `parallel` and `evaluator_loop` topologies are gated to internal tenants: publishing one without `settings.topology_flags.<topology>` answers 409. Creating and drafting them is not gated — only publish is, so a graph can be built long before it is allowed to go live. The eval run is fire-and-forget: it is NOT awaited and its failure is logged, never surfaced, so a 200 here says the graph published, not that its tests passed. Poll GET /ai-agent-graphs/{id}/tests/runs for that. Returns `{ graph, version }`.
48719
+ * @description The only validating write on this resource, and the one with real consequences. In order: enforce the tenant `editable_window` (409 outside it); promote the draft onto the live shape, **replacing the node set wholesale** if the draft carries `nodes`; hard-validate (400 on a bad graph — and the draft has already been promoted by then); snapshot into a new `ai_agent_graph_version`; move `published_version_id`; dispatch the `ai_agent_graph.publish` webhook; The `parallel` and `evaluator_loop` topologies are gated to internal tenants: publishing one without `settings.topology_flags.<topology>` answers 409. Creating and drafting them is not gated — only publish is, so a graph can be built long before it is allowed to go live. Publishing never runs the graph eval suite (evals run only on demand: `POST /ai-agent-graphs/{id}/tests/run`); `skip_eval` is accepted and ignored. Returns `{ graph, version }`.
48709
48720
  */
48710
48721
  post: {
48711
48722
  parameters: {
@@ -82189,6 +82200,367 @@ interface paths {
82189
82200
  patch?: never;
82190
82201
  trace?: never;
82191
82202
  };
82203
+ "/agent-evals/activation": {
82204
+ parameters: {
82205
+ query?: never;
82206
+ header?: never;
82207
+ path?: never;
82208
+ cookie?: never;
82209
+ };
82210
+ /**
82211
+ * The workspace's evals opt-in and price
82212
+ * @description Evals are charged per completed run (passed, partial or failed) at the rate card's price — today 0.0025 UF per run — as a usage line on the monthly invoice («Evaluaciones del agente»). They are OFF until a workspace owner/admin turns them on and accepts that price; until then every run endpoint answers 402 `AGENT_EVALS_NOT_ENABLED` and nothing is queued or billed.
82213
+ *
82214
+ * Returns whether evals are on, the current price, and who accepted it, when and at what price.
82215
+ */
82216
+ get: {
82217
+ parameters: {
82218
+ query?: never;
82219
+ header?: never;
82220
+ path?: never;
82221
+ cookie?: never;
82222
+ };
82223
+ requestBody?: never;
82224
+ responses: {
82225
+ /** @description The opt-in */
82226
+ 200: {
82227
+ headers: {
82228
+ [name: string]: unknown;
82229
+ };
82230
+ content: {
82231
+ /**
82232
+ * @example {
82233
+ * "data": {
82234
+ * "enabled": true,
82235
+ * "state": "enabled",
82236
+ * "price": {
82237
+ * "uf_per_run": 0.0025,
82238
+ * "label": "0,0025"
82239
+ * },
82240
+ * "acceptance": {
82241
+ * "accepted_by": "10000000-0000-4000-8000-000000000001",
82242
+ * "accepted_by_name": "Ana Pérez",
82243
+ * "accepted_at": "2026-10-17T16:00:00.000Z",
82244
+ * "uf_per_run": 0.0025,
82245
+ * "rate_card": "standard"
82246
+ * },
82247
+ * "billable": true,
82248
+ * "can_enable": true
82249
+ * }
82250
+ * }
82251
+ */
82252
+ "application/json": {
82253
+ /** @description Evals may run in this workspace now. */
82254
+ enabled: boolean;
82255
+ /** @enum {string} */
82256
+ state: "enabled" | "not_enabled" | "disabled" | "suspended" | "internal" | "sandbox";
82257
+ price: {
82258
+ /** @description UF per completed eval run. */
82259
+ uf_per_run: number;
82260
+ /** @description The same price as a person reads it: «0,0025». */
82261
+ label: string;
82262
+ };
82263
+ /** @description Who turned evals on, when, and at what price. */
82264
+ acceptance: {
82265
+ accepted_by: string;
82266
+ accepted_by_name: string | null;
82267
+ accepted_at: string;
82268
+ uf_per_run: number;
82269
+ rate_card: string;
82270
+ } | null;
82271
+ /** @description Runs are invoiced (false for internal or complimentary workspaces). */
82272
+ billable: boolean;
82273
+ can_enable: boolean;
82274
+ };
82275
+ };
82276
+ };
82277
+ /** @description Validation error */
82278
+ 400: {
82279
+ headers: {
82280
+ [name: string]: unknown;
82281
+ };
82282
+ content: {
82283
+ "application/json": components["schemas"]["Error"];
82284
+ };
82285
+ };
82286
+ /** @description Unauthorized */
82287
+ 401: {
82288
+ headers: {
82289
+ [name: string]: unknown;
82290
+ };
82291
+ content: {
82292
+ "application/json": components["schemas"]["Error"];
82293
+ };
82294
+ };
82295
+ /** @description Forbidden */
82296
+ 403: {
82297
+ headers: {
82298
+ [name: string]: unknown;
82299
+ };
82300
+ content: {
82301
+ "application/json": components["schemas"]["Error"];
82302
+ };
82303
+ };
82304
+ /** @description Not found */
82305
+ 404: {
82306
+ headers: {
82307
+ [name: string]: unknown;
82308
+ };
82309
+ content: {
82310
+ "application/json": components["schemas"]["Error"];
82311
+ };
82312
+ };
82313
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
82314
+ 409: {
82315
+ headers: {
82316
+ [name: string]: unknown;
82317
+ };
82318
+ content: {
82319
+ "application/json": components["schemas"]["Error"];
82320
+ };
82321
+ };
82322
+ /** @description Rate limited */
82323
+ 429: {
82324
+ headers: {
82325
+ [name: string]: unknown;
82326
+ };
82327
+ content: {
82328
+ "application/json": components["schemas"]["Error"];
82329
+ };
82330
+ };
82331
+ };
82332
+ };
82333
+ put?: never;
82334
+ /**
82335
+ * Turn evals on and accept the per-run price
82336
+ * @description Evals are charged per completed run (passed, partial or failed) at the rate card's price — today 0.0025 UF per run — as a usage line on the monthly invoice («Evaluaciones del agente»). They are OFF until a workspace owner/admin turns them on and accepts that price; until then every run endpoint answers 402 `AGENT_EVALS_NOT_ENABLED` and nothing is queued or billed.
82337
+ *
82338
+ * Owner/admin members only (403 otherwise, including an API key: a price is accepted by a person). `accept_uf_per_run` must be the current price, else 409 `AGENT_EVALS_PRICE_CHANGED`. Records who accepted, when and at what price. Idempotent.
82339
+ */
82340
+ post: {
82341
+ parameters: {
82342
+ query?: never;
82343
+ header?: {
82344
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
82345
+ "Idempotency-Key"?: string;
82346
+ };
82347
+ path?: never;
82348
+ cookie?: never;
82349
+ };
82350
+ requestBody?: {
82351
+ content: {
82352
+ /**
82353
+ * @example {
82354
+ * "accept_uf_per_run": 0.0025
82355
+ * }
82356
+ */
82357
+ "application/json": {
82358
+ /** @description The UF price per completed eval run the admin accepted — must be the current one. */
82359
+ accept_uf_per_run: number;
82360
+ };
82361
+ };
82362
+ };
82363
+ responses: {
82364
+ /** @description The opt-in, now `enabled` */
82365
+ 200: {
82366
+ headers: {
82367
+ [name: string]: unknown;
82368
+ };
82369
+ content: {
82370
+ /**
82371
+ * @example {
82372
+ * "data": {
82373
+ * "enabled": true,
82374
+ * "state": "enabled",
82375
+ * "price": {
82376
+ * "uf_per_run": 0.0025,
82377
+ * "label": "0,0025"
82378
+ * },
82379
+ * "acceptance": {
82380
+ * "accepted_by": "10000000-0000-4000-8000-000000000001",
82381
+ * "accepted_by_name": "Ana Pérez",
82382
+ * "accepted_at": "2026-10-17T16:00:00.000Z",
82383
+ * "uf_per_run": 0.0025,
82384
+ * "rate_card": "standard"
82385
+ * },
82386
+ * "billable": true,
82387
+ * "can_enable": true
82388
+ * }
82389
+ * }
82390
+ */
82391
+ "application/json": {
82392
+ data?: unknown;
82393
+ meta?: {
82394
+ [key: string]: unknown;
82395
+ };
82396
+ };
82397
+ };
82398
+ };
82399
+ /** @description Validation error */
82400
+ 400: {
82401
+ headers: {
82402
+ [name: string]: unknown;
82403
+ };
82404
+ content: {
82405
+ "application/json": components["schemas"]["Error"];
82406
+ };
82407
+ };
82408
+ /** @description Unauthorized */
82409
+ 401: {
82410
+ headers: {
82411
+ [name: string]: unknown;
82412
+ };
82413
+ content: {
82414
+ "application/json": components["schemas"]["Error"];
82415
+ };
82416
+ };
82417
+ /** @description Forbidden */
82418
+ 403: {
82419
+ headers: {
82420
+ [name: string]: unknown;
82421
+ };
82422
+ content: {
82423
+ "application/json": components["schemas"]["Error"];
82424
+ };
82425
+ };
82426
+ /** @description Not found */
82427
+ 404: {
82428
+ headers: {
82429
+ [name: string]: unknown;
82430
+ };
82431
+ content: {
82432
+ "application/json": components["schemas"]["Error"];
82433
+ };
82434
+ };
82435
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
82436
+ 409: {
82437
+ headers: {
82438
+ [name: string]: unknown;
82439
+ };
82440
+ content: {
82441
+ "application/json": components["schemas"]["Error"];
82442
+ };
82443
+ };
82444
+ /** @description Rate limited */
82445
+ 429: {
82446
+ headers: {
82447
+ [name: string]: unknown;
82448
+ };
82449
+ content: {
82450
+ "application/json": components["schemas"]["Error"];
82451
+ };
82452
+ };
82453
+ };
82454
+ };
82455
+ /**
82456
+ * Turn evals off
82457
+ * @description Immediate: no new run is queued after this. Runs already queued finish and bill at the accepted price. The acceptance stays on record.
82458
+ */
82459
+ delete: {
82460
+ parameters: {
82461
+ query?: never;
82462
+ header?: never;
82463
+ path?: never;
82464
+ cookie?: never;
82465
+ };
82466
+ requestBody?: never;
82467
+ responses: {
82468
+ /** @description The opt-in, now `disabled` */
82469
+ 200: {
82470
+ headers: {
82471
+ [name: string]: unknown;
82472
+ };
82473
+ content: {
82474
+ /**
82475
+ * @example {
82476
+ * "data": {
82477
+ * "enabled": false,
82478
+ * "state": "disabled",
82479
+ * "price": {
82480
+ * "uf_per_run": 0.0025,
82481
+ * "label": "0,0025"
82482
+ * },
82483
+ * "acceptance": {
82484
+ * "accepted_by": "10000000-0000-4000-8000-000000000001",
82485
+ * "accepted_by_name": "Ana Pérez",
82486
+ * "accepted_at": "2026-10-17T16:00:00.000Z",
82487
+ * "uf_per_run": 0.0025,
82488
+ * "rate_card": "standard"
82489
+ * },
82490
+ * "billable": true,
82491
+ * "can_enable": true
82492
+ * }
82493
+ * }
82494
+ */
82495
+ "application/json": {
82496
+ data?: unknown;
82497
+ meta?: {
82498
+ [key: string]: unknown;
82499
+ };
82500
+ };
82501
+ };
82502
+ };
82503
+ /** @description Validation error */
82504
+ 400: {
82505
+ headers: {
82506
+ [name: string]: unknown;
82507
+ };
82508
+ content: {
82509
+ "application/json": components["schemas"]["Error"];
82510
+ };
82511
+ };
82512
+ /** @description Unauthorized */
82513
+ 401: {
82514
+ headers: {
82515
+ [name: string]: unknown;
82516
+ };
82517
+ content: {
82518
+ "application/json": components["schemas"]["Error"];
82519
+ };
82520
+ };
82521
+ /** @description Forbidden */
82522
+ 403: {
82523
+ headers: {
82524
+ [name: string]: unknown;
82525
+ };
82526
+ content: {
82527
+ "application/json": components["schemas"]["Error"];
82528
+ };
82529
+ };
82530
+ /** @description Not found */
82531
+ 404: {
82532
+ headers: {
82533
+ [name: string]: unknown;
82534
+ };
82535
+ content: {
82536
+ "application/json": components["schemas"]["Error"];
82537
+ };
82538
+ };
82539
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
82540
+ 409: {
82541
+ headers: {
82542
+ [name: string]: unknown;
82543
+ };
82544
+ content: {
82545
+ "application/json": components["schemas"]["Error"];
82546
+ };
82547
+ };
82548
+ /** @description Rate limited */
82549
+ 429: {
82550
+ headers: {
82551
+ [name: string]: unknown;
82552
+ };
82553
+ content: {
82554
+ "application/json": components["schemas"]["Error"];
82555
+ };
82556
+ };
82557
+ };
82558
+ };
82559
+ options?: never;
82560
+ head?: never;
82561
+ patch?: never;
82562
+ trace?: never;
82563
+ };
82192
82564
  "/ai-agents/{id}/publish-gate": {
82193
82565
  parameters: {
82194
82566
  query?: never;
@@ -82197,8 +82569,8 @@ interface paths {
82197
82569
  cookie?: never;
82198
82570
  };
82199
82571
  /**
82200
- * Would publishing this agent be refused by its evals?
82201
- * @description Reads the agent's ENABLED GOLDEN suite and nothing else.
82572
+ * What the agent's golden suite last said (informational)
82573
+ * @description INFORMATIONAL ONLY since app#3975: publishing never runs, waits on or is blocked by evals. Reads the agent's ENABLED GOLDEN suite and nothing else.
82202
82574
  *
82203
82575
  * - `none` — no enabled golden suite. Never blocks: a workspace that has not opted into gating is not gated.
82204
82576
  * - `pending` — a golden suite run is queued or running. Warn only; blocking here would mean "press publish again in four minutes".
@@ -82208,7 +82580,7 @@ interface paths {
82208
82580
  *
82209
82581
  * `reasons` are stable snake_case codes (`no_golden_suite`, `suite_run_in_flight`, `no_completed_run`, `stale_draft`, `hard_fails`, `pass_rate_below_min`) so the dialog can localize them. `failing` lists the red scenarios of the last completed run with their `run_id`s.
82210
82582
  *
82211
- * `blocked` and `stale` make `POST /ai-agents/{id}/publish` answer **409** `{ error, code: 'evals_blocked' | 'evals_stale', gate }` unless the body carries `force: true`.
82583
+ * `blocked` and `stale` no longer refuse a publish.
82212
82584
  */
82213
82585
  get: {
82214
82586
  parameters: {
@@ -89128,7 +89500,7 @@ interface paths {
89128
89500
  };
89129
89501
  /**
89130
89502
  * Fetch one campaign with its stats
89131
- * @description The campaign plus its delivery counters — this is the read to poll while a send is in progress. A WhatsApp campaign that is not finished also carries `pacing` (ADR 0129): its number’s tier and `limit_per_24h`, `sent_last_24h`, `pending`, `waiting` (a paced campaign waiting for the window) with `next_batch_at`, `estimated_completion_at` and `windows_remaining`, plus the effective `send_window` (`send_window_source`: campaign | workspace), its `window_label` and `next_window_opens_at` (outside the window now); null when the budget cannot be read. With a `send_schedule` (ADR 0139) it also carries `schedule_label`, `next_slot_at`, `batches` (what each slot did: planned / sent / failed / skipped_reason, oldest first) and `schedule` — the pending part simulated slot by slot.
89503
+ * @description The campaign plus its delivery counters — this is the read to poll while a send is in progress. A WhatsApp campaign that is not finished also carries `pacing` (ADR 0129): its number’s tier and `limit_per_24h`, `sent_last_24h`, `pending`, `waiting` (a paced campaign waiting for the window) with `next_batch_at`, `estimated_completion_at` and `windows_remaining`, plus the effective `send_window` (`send_window_source`: campaign | workspace), its `window_label` and `next_window_opens_at` (outside the window now); null when the budget cannot be read. With a `send_schedule` (ADR 0139) it also carries `schedule_label`, `next_slot_at`, `batches` (what each slot did: planned / sent / failed / skipped_reason, oldest first) and `schedule` — the pending part simulated slot by slot. A campaign paused with `paused_reason: delivery_guard` carries `paused_detail` (`sends`, `undeliverable` 131026, `withheld` 131049, `rate` 0-1), computed from the recipients; null otherwise.
89132
89504
  */
89133
89505
  get: {
89134
89506
  parameters: {
@@ -90062,7 +90434,7 @@ interface paths {
90062
90434
  put?: never;
90063
90435
  /**
90064
90436
  * Pause the campaign
90065
- * @description Legal from `sending` and `scheduled`; a 409 otherwise. Stops further delivery — messages already sent are already sent.
90437
+ * @description Legal from `sending` and `scheduled`; a 409 otherwise. Stops further delivery — messages already sent are already sent. A person's pause reads `paused_reason: manual`. The platform also pauses on its own: `messaging_limit` (Meta pushed back; resumes by itself within the hour), `number_quality` (the WhatsApp number's quality turned RED; every sending or scheduled campaign on the number and its WABA siblings stops, and only a person resumes it), `budget_exhausted`, `delivery_guard` (WhatsApp: undeliverable 131026 + withheld 131049 failures passed 10% of the sends, after 50), `pilot`, `schedule_exhausted`, `config_error` and `reputation_guard` (email). Each automatic pause fires the `campaign.paused` webhook.
90066
90438
  */
90067
90439
  post: {
90068
90440
  parameters: {
@@ -90214,6 +90586,8 @@ interface paths {
90214
90586
  *
90215
90587
  * An optional body `{ send_mode }` switches how the rest is sent — e.g. an `asap` campaign the messaging-limit budget paused (`budget_exhausted`) resumed as `paced` continues by itself across the following days. A pilot (`paused_reason: pilot`) resumes into the full send.
90216
90588
  *
90589
+ * **A WhatsApp number whose quality is not GREEN asks for confirmation.** When the stored quality of the campaign's number is YELLOW or RED (or unknown after a `number_quality` pause), a resume without `acknowledge_quality: true` answers 409 with `details: { reason: "number_quality_not_green", quality_rating: "RED" | "YELLOW" | null }` and leaves it paused; with it, the campaign resumes. Nothing resumes a `number_quality` pause automatically.
90590
+ *
90217
90591
  * A 409 if the campaign is not paused. An EMAIL campaign is re-checked against the connected-mailbox rule before it resumes (a mailbox may have been connected, or the sending domain removed, while it was paused): a 422 `CAMPAIGN_FROM_CONNECTED_MAILBOX` leaves it paused.
90218
90592
  */
90219
90593
  post: {
@@ -187679,7 +188053,7 @@ interface components {
187679
188053
  /** @enum {string} */
187680
188054
  kind: "list";
187681
188055
  /** @enum {string} */
187682
- screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals";
188056
+ screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals" | "campaigns";
187683
188057
  filter: {
187684
188058
  [key: string]: string | number | boolean;
187685
188059
  };
@@ -187721,7 +188095,7 @@ interface components {
187721
188095
  /** @enum {string} */
187722
188096
  kind: "list";
187723
188097
  /** @enum {string} */
187724
- screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals";
188098
+ screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals" | "campaigns";
187725
188099
  filter: {
187726
188100
  [key: string]: string | number | boolean;
187727
188101
  };
@@ -187748,7 +188122,7 @@ interface components {
187748
188122
  /** @enum {string} */
187749
188123
  kind: "list";
187750
188124
  /** @enum {string} */
187751
- screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals";
188125
+ screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals" | "campaigns";
187752
188126
  filter: {
187753
188127
  [key: string]: string | number | boolean;
187754
188128
  };
@@ -188132,13 +188506,15 @@ interface components {
188132
188506
  conversations: number;
188133
188507
  voice_minutes: number;
188134
188508
  forwarded_voice_minutes: number;
188509
+ /** @description Completed agent-eval runs billed this month (queued after an admin accepted the per-run price). */
188510
+ eval_runs: number;
188135
188511
  email_marketable_contacts: number;
188136
188512
  /** @description Email-campaign messages sent this month; the contact-base line is billed only when above 0. */
188137
188513
  email_marketing_sent: number;
188138
188514
  };
188139
188515
  lines: {
188140
188516
  /** @enum {string} */
188141
- kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188517
+ kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "eval_runs" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188142
188518
  count: number;
188143
188519
  uf_unit: number | null;
188144
188520
  uf_subtotal: number | null;
@@ -188166,9 +188542,10 @@ interface components {
188166
188542
  conversations: number;
188167
188543
  voice_minutes: number;
188168
188544
  forwarded_voice_minutes: number;
188545
+ eval_runs: number;
188169
188546
  lines: {
188170
188547
  /** @enum {string} */
188171
- kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188548
+ kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "eval_runs" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188172
188549
  count: number;
188173
188550
  uf_unit: number | null;
188174
188551
  uf_subtotal: number | null;
@@ -188319,7 +188696,7 @@ interface components {
188319
188696
  days: string[];
188320
188697
  series: {
188321
188698
  /** @enum {string} */
188322
- metric: "conversations" | "voice_minutes" | "forwarded_voice_minutes" | "email_marketing_sent" | "addon_usage";
188699
+ metric: "conversations" | "voice_minutes" | "forwarded_voice_minutes" | "eval_runs" | "email_marketing_sent" | "addon_usage";
188323
188700
  /** @description `addon_usage` only: the add-on feature key. */
188324
188701
  feature: string | null;
188325
188702
  /** @description Σ `values`. */
@@ -188343,7 +188720,7 @@ interface components {
188343
188720
  clp_total: number | null;
188344
188721
  lines: {
188345
188722
  /** @enum {string} */
188346
- kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188723
+ kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "eval_runs" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188347
188724
  count: number;
188348
188725
  uf_unit: number | null;
188349
188726
  uf_subtotal: number | null;
@@ -189983,6 +190360,8 @@ interface components {
189983
190360
  * @enum {string}
189984
190361
  */
189985
190362
  send_mode?: "paced" | "asap";
190363
+ /** @description Resume a WhatsApp campaign although its number's quality is not GREEN (YELLOW or RED, or unknown after a `number_quality` pause). Without it such a resume answers 409 with `details.reason: number_quality_not_green` and `details.quality_rating`. */
190364
+ acknowledge_quality?: boolean;
189986
190365
  };
189987
190366
  CampaignRecipient: {
189988
190367
  /** Format: uuid */
package/dist/index.d.ts CHANGED
@@ -2402,7 +2402,7 @@ interface paths {
2402
2402
  put?: never;
2403
2403
  /**
2404
2404
  * Atomically promote the draft onto the live runtime + snapshot a version
2405
- * @description Gated by Agent Evals (ADR 0098): when the agent has an ENABLED GOLDEN suite whose gate is `blocked` or `stale`, this answers **409** `{ error, code: 'evals_blocked' | 'evals_stale', gate }` — see `GET /ai-agents/{id}/publish-gate` for the semantics. `force: true` publishes anyway and is recorded in the audit log with the actor. `skip_eval: true` skips the post-publish suite/scenario run; it does NOT bypass the gate.
2405
+ * @description Publishing never runs, waits on or is blocked by Agent Evals: evals run only when someone asks for them (`POST /ai-agents/{id}/scenarios/run`). `force` and `skip_eval` are accepted for compatibility and ignored. `GET /ai-agents/{id}/publish-gate` is informational only.
2406
2406
  *
2407
2407
  * **Optimistic concurrency.** `expected_draft_version` (or `If-Match`) is the `draft_version` you reviewed: if someone staged changes since, the publish is refused with 409 `VERSION_CONFLICT` instead of shipping a draft you have not seen. A draft started on a live config that has since changed (e.g. `PUT /ai-agents/{id}/system-prompt` while it was staged) is refused with 409 `VERSION_CONFLICT` reason `draft_base_stale` — publishing it would silently overwrite that change; send `expected_config_version` equal to the current `config_version` to publish over it deliberately, or discard and restage. The response carries the new live `config_version`.
2408
2408
  */
@@ -34471,7 +34471,7 @@ interface paths {
34471
34471
  *
34472
34472
  * With `period=YYYY-MM` (a past Santiago month, #3760) the same shape describes that month: its meters over the whole month, and for the amount only what was billed — the issued cobro's frozen `lines` and `totals` with its frozen UF (`amount_source: invoice`), a month invoiced by hand (`external`) or nothing (`none`, usage only); never today's prices. A cobro that froze its billed set counts conversations from it (`conversations_source: invoice`), so the count equals the cobro's. `projection` is null for a past month. A future month is a 400.
34473
34473
  *
34474
- * `daily` carries every metric per Santiago day (conversations, voice and forwarded minutes, email-campaign sends, per-unit add-on usage); each series' `total` is the sum of its days. `GET /billing/usage/export` is the same as CSV.
34474
+ * `daily` carries every metric per Santiago day (conversations, voice and forwarded minutes, billed agent-eval runs, email-campaign sends, per-unit add-on usage); each series' `total` is the sum of its days. `GET /billing/usage/export` is the same as CSV.
34475
34475
  *
34476
34476
  * `next_charge` (current month only; null for a past month or when prices are hidden) is the cobro the close will issue: its cut-off, issue and charge dates, whether it is charged automatically or paid by transfer, and its lines in pesos (so far and at month end) exactly as the hosted cobro will show them. Counts and money only, never conversation content. Requires `billing:read`.
34477
34477
  */
@@ -34517,6 +34517,7 @@ interface paths {
34517
34517
  * "conversations": 3,
34518
34518
  * "voice_minutes": 4,
34519
34519
  * "forwarded_voice_minutes": 0,
34520
+ * "eval_runs": 0,
34520
34521
  * "email_marketable_contacts": 0,
34521
34522
  * "email_marketing_sent": 0
34522
34523
  * },
@@ -34588,6 +34589,16 @@ interface paths {
34588
34589
  * ]
34589
34590
  * },
34590
34591
  * {
34592
+ * "metric": "eval_runs",
34593
+ * "feature": null,
34594
+ * "total": 0,
34595
+ * "values": [
34596
+ * 0,
34597
+ * 0,
34598
+ * 0
34599
+ * ]
34600
+ * },
34601
+ * {
34591
34602
  * "metric": "email_marketing_sent",
34592
34603
  * "feature": null,
34593
34604
  * "total": 0,
@@ -48705,7 +48716,7 @@ interface paths {
48705
48716
  put?: never;
48706
48717
  /**
48707
48718
  * Publish the graph
48708
- * @description The only validating write on this resource, and the one with real consequences. In order: enforce the tenant `editable_window` (409 outside it); promote the draft onto the live shape, **replacing the node set wholesale** if the draft carries `nodes`; hard-validate (400 on a bad graph — and the draft has already been promoted by then); snapshot into a new `ai_agent_graph_version`; move `published_version_id`; dispatch the `ai_agent_graph.publish` webhook; and, unless `skip_eval` is set, start the graph eval suite. The `parallel` and `evaluator_loop` topologies are gated to internal tenants: publishing one without `settings.topology_flags.<topology>` answers 409. Creating and drafting them is not gated — only publish is, so a graph can be built long before it is allowed to go live. The eval run is fire-and-forget: it is NOT awaited and its failure is logged, never surfaced, so a 200 here says the graph published, not that its tests passed. Poll GET /ai-agent-graphs/{id}/tests/runs for that. Returns `{ graph, version }`.
48719
+ * @description The only validating write on this resource, and the one with real consequences. In order: enforce the tenant `editable_window` (409 outside it); promote the draft onto the live shape, **replacing the node set wholesale** if the draft carries `nodes`; hard-validate (400 on a bad graph — and the draft has already been promoted by then); snapshot into a new `ai_agent_graph_version`; move `published_version_id`; dispatch the `ai_agent_graph.publish` webhook; The `parallel` and `evaluator_loop` topologies are gated to internal tenants: publishing one without `settings.topology_flags.<topology>` answers 409. Creating and drafting them is not gated — only publish is, so a graph can be built long before it is allowed to go live. Publishing never runs the graph eval suite (evals run only on demand: `POST /ai-agent-graphs/{id}/tests/run`); `skip_eval` is accepted and ignored. Returns `{ graph, version }`.
48709
48720
  */
48710
48721
  post: {
48711
48722
  parameters: {
@@ -82189,6 +82200,367 @@ interface paths {
82189
82200
  patch?: never;
82190
82201
  trace?: never;
82191
82202
  };
82203
+ "/agent-evals/activation": {
82204
+ parameters: {
82205
+ query?: never;
82206
+ header?: never;
82207
+ path?: never;
82208
+ cookie?: never;
82209
+ };
82210
+ /**
82211
+ * The workspace's evals opt-in and price
82212
+ * @description Evals are charged per completed run (passed, partial or failed) at the rate card's price — today 0.0025 UF per run — as a usage line on the monthly invoice («Evaluaciones del agente»). They are OFF until a workspace owner/admin turns them on and accepts that price; until then every run endpoint answers 402 `AGENT_EVALS_NOT_ENABLED` and nothing is queued or billed.
82213
+ *
82214
+ * Returns whether evals are on, the current price, and who accepted it, when and at what price.
82215
+ */
82216
+ get: {
82217
+ parameters: {
82218
+ query?: never;
82219
+ header?: never;
82220
+ path?: never;
82221
+ cookie?: never;
82222
+ };
82223
+ requestBody?: never;
82224
+ responses: {
82225
+ /** @description The opt-in */
82226
+ 200: {
82227
+ headers: {
82228
+ [name: string]: unknown;
82229
+ };
82230
+ content: {
82231
+ /**
82232
+ * @example {
82233
+ * "data": {
82234
+ * "enabled": true,
82235
+ * "state": "enabled",
82236
+ * "price": {
82237
+ * "uf_per_run": 0.0025,
82238
+ * "label": "0,0025"
82239
+ * },
82240
+ * "acceptance": {
82241
+ * "accepted_by": "10000000-0000-4000-8000-000000000001",
82242
+ * "accepted_by_name": "Ana Pérez",
82243
+ * "accepted_at": "2026-10-17T16:00:00.000Z",
82244
+ * "uf_per_run": 0.0025,
82245
+ * "rate_card": "standard"
82246
+ * },
82247
+ * "billable": true,
82248
+ * "can_enable": true
82249
+ * }
82250
+ * }
82251
+ */
82252
+ "application/json": {
82253
+ /** @description Evals may run in this workspace now. */
82254
+ enabled: boolean;
82255
+ /** @enum {string} */
82256
+ state: "enabled" | "not_enabled" | "disabled" | "suspended" | "internal" | "sandbox";
82257
+ price: {
82258
+ /** @description UF per completed eval run. */
82259
+ uf_per_run: number;
82260
+ /** @description The same price as a person reads it: «0,0025». */
82261
+ label: string;
82262
+ };
82263
+ /** @description Who turned evals on, when, and at what price. */
82264
+ acceptance: {
82265
+ accepted_by: string;
82266
+ accepted_by_name: string | null;
82267
+ accepted_at: string;
82268
+ uf_per_run: number;
82269
+ rate_card: string;
82270
+ } | null;
82271
+ /** @description Runs are invoiced (false for internal or complimentary workspaces). */
82272
+ billable: boolean;
82273
+ can_enable: boolean;
82274
+ };
82275
+ };
82276
+ };
82277
+ /** @description Validation error */
82278
+ 400: {
82279
+ headers: {
82280
+ [name: string]: unknown;
82281
+ };
82282
+ content: {
82283
+ "application/json": components["schemas"]["Error"];
82284
+ };
82285
+ };
82286
+ /** @description Unauthorized */
82287
+ 401: {
82288
+ headers: {
82289
+ [name: string]: unknown;
82290
+ };
82291
+ content: {
82292
+ "application/json": components["schemas"]["Error"];
82293
+ };
82294
+ };
82295
+ /** @description Forbidden */
82296
+ 403: {
82297
+ headers: {
82298
+ [name: string]: unknown;
82299
+ };
82300
+ content: {
82301
+ "application/json": components["schemas"]["Error"];
82302
+ };
82303
+ };
82304
+ /** @description Not found */
82305
+ 404: {
82306
+ headers: {
82307
+ [name: string]: unknown;
82308
+ };
82309
+ content: {
82310
+ "application/json": components["schemas"]["Error"];
82311
+ };
82312
+ };
82313
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
82314
+ 409: {
82315
+ headers: {
82316
+ [name: string]: unknown;
82317
+ };
82318
+ content: {
82319
+ "application/json": components["schemas"]["Error"];
82320
+ };
82321
+ };
82322
+ /** @description Rate limited */
82323
+ 429: {
82324
+ headers: {
82325
+ [name: string]: unknown;
82326
+ };
82327
+ content: {
82328
+ "application/json": components["schemas"]["Error"];
82329
+ };
82330
+ };
82331
+ };
82332
+ };
82333
+ put?: never;
82334
+ /**
82335
+ * Turn evals on and accept the per-run price
82336
+ * @description Evals are charged per completed run (passed, partial or failed) at the rate card's price — today 0.0025 UF per run — as a usage line on the monthly invoice («Evaluaciones del agente»). They are OFF until a workspace owner/admin turns them on and accepts that price; until then every run endpoint answers 402 `AGENT_EVALS_NOT_ENABLED` and nothing is queued or billed.
82337
+ *
82338
+ * Owner/admin members only (403 otherwise, including an API key: a price is accepted by a person). `accept_uf_per_run` must be the current price, else 409 `AGENT_EVALS_PRICE_CHANGED`. Records who accepted, when and at what price. Idempotent.
82339
+ */
82340
+ post: {
82341
+ parameters: {
82342
+ query?: never;
82343
+ header?: {
82344
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
82345
+ "Idempotency-Key"?: string;
82346
+ };
82347
+ path?: never;
82348
+ cookie?: never;
82349
+ };
82350
+ requestBody?: {
82351
+ content: {
82352
+ /**
82353
+ * @example {
82354
+ * "accept_uf_per_run": 0.0025
82355
+ * }
82356
+ */
82357
+ "application/json": {
82358
+ /** @description The UF price per completed eval run the admin accepted — must be the current one. */
82359
+ accept_uf_per_run: number;
82360
+ };
82361
+ };
82362
+ };
82363
+ responses: {
82364
+ /** @description The opt-in, now `enabled` */
82365
+ 200: {
82366
+ headers: {
82367
+ [name: string]: unknown;
82368
+ };
82369
+ content: {
82370
+ /**
82371
+ * @example {
82372
+ * "data": {
82373
+ * "enabled": true,
82374
+ * "state": "enabled",
82375
+ * "price": {
82376
+ * "uf_per_run": 0.0025,
82377
+ * "label": "0,0025"
82378
+ * },
82379
+ * "acceptance": {
82380
+ * "accepted_by": "10000000-0000-4000-8000-000000000001",
82381
+ * "accepted_by_name": "Ana Pérez",
82382
+ * "accepted_at": "2026-10-17T16:00:00.000Z",
82383
+ * "uf_per_run": 0.0025,
82384
+ * "rate_card": "standard"
82385
+ * },
82386
+ * "billable": true,
82387
+ * "can_enable": true
82388
+ * }
82389
+ * }
82390
+ */
82391
+ "application/json": {
82392
+ data?: unknown;
82393
+ meta?: {
82394
+ [key: string]: unknown;
82395
+ };
82396
+ };
82397
+ };
82398
+ };
82399
+ /** @description Validation error */
82400
+ 400: {
82401
+ headers: {
82402
+ [name: string]: unknown;
82403
+ };
82404
+ content: {
82405
+ "application/json": components["schemas"]["Error"];
82406
+ };
82407
+ };
82408
+ /** @description Unauthorized */
82409
+ 401: {
82410
+ headers: {
82411
+ [name: string]: unknown;
82412
+ };
82413
+ content: {
82414
+ "application/json": components["schemas"]["Error"];
82415
+ };
82416
+ };
82417
+ /** @description Forbidden */
82418
+ 403: {
82419
+ headers: {
82420
+ [name: string]: unknown;
82421
+ };
82422
+ content: {
82423
+ "application/json": components["schemas"]["Error"];
82424
+ };
82425
+ };
82426
+ /** @description Not found */
82427
+ 404: {
82428
+ headers: {
82429
+ [name: string]: unknown;
82430
+ };
82431
+ content: {
82432
+ "application/json": components["schemas"]["Error"];
82433
+ };
82434
+ };
82435
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
82436
+ 409: {
82437
+ headers: {
82438
+ [name: string]: unknown;
82439
+ };
82440
+ content: {
82441
+ "application/json": components["schemas"]["Error"];
82442
+ };
82443
+ };
82444
+ /** @description Rate limited */
82445
+ 429: {
82446
+ headers: {
82447
+ [name: string]: unknown;
82448
+ };
82449
+ content: {
82450
+ "application/json": components["schemas"]["Error"];
82451
+ };
82452
+ };
82453
+ };
82454
+ };
82455
+ /**
82456
+ * Turn evals off
82457
+ * @description Immediate: no new run is queued after this. Runs already queued finish and bill at the accepted price. The acceptance stays on record.
82458
+ */
82459
+ delete: {
82460
+ parameters: {
82461
+ query?: never;
82462
+ header?: never;
82463
+ path?: never;
82464
+ cookie?: never;
82465
+ };
82466
+ requestBody?: never;
82467
+ responses: {
82468
+ /** @description The opt-in, now `disabled` */
82469
+ 200: {
82470
+ headers: {
82471
+ [name: string]: unknown;
82472
+ };
82473
+ content: {
82474
+ /**
82475
+ * @example {
82476
+ * "data": {
82477
+ * "enabled": false,
82478
+ * "state": "disabled",
82479
+ * "price": {
82480
+ * "uf_per_run": 0.0025,
82481
+ * "label": "0,0025"
82482
+ * },
82483
+ * "acceptance": {
82484
+ * "accepted_by": "10000000-0000-4000-8000-000000000001",
82485
+ * "accepted_by_name": "Ana Pérez",
82486
+ * "accepted_at": "2026-10-17T16:00:00.000Z",
82487
+ * "uf_per_run": 0.0025,
82488
+ * "rate_card": "standard"
82489
+ * },
82490
+ * "billable": true,
82491
+ * "can_enable": true
82492
+ * }
82493
+ * }
82494
+ */
82495
+ "application/json": {
82496
+ data?: unknown;
82497
+ meta?: {
82498
+ [key: string]: unknown;
82499
+ };
82500
+ };
82501
+ };
82502
+ };
82503
+ /** @description Validation error */
82504
+ 400: {
82505
+ headers: {
82506
+ [name: string]: unknown;
82507
+ };
82508
+ content: {
82509
+ "application/json": components["schemas"]["Error"];
82510
+ };
82511
+ };
82512
+ /** @description Unauthorized */
82513
+ 401: {
82514
+ headers: {
82515
+ [name: string]: unknown;
82516
+ };
82517
+ content: {
82518
+ "application/json": components["schemas"]["Error"];
82519
+ };
82520
+ };
82521
+ /** @description Forbidden */
82522
+ 403: {
82523
+ headers: {
82524
+ [name: string]: unknown;
82525
+ };
82526
+ content: {
82527
+ "application/json": components["schemas"]["Error"];
82528
+ };
82529
+ };
82530
+ /** @description Not found */
82531
+ 404: {
82532
+ headers: {
82533
+ [name: string]: unknown;
82534
+ };
82535
+ content: {
82536
+ "application/json": components["schemas"]["Error"];
82537
+ };
82538
+ };
82539
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
82540
+ 409: {
82541
+ headers: {
82542
+ [name: string]: unknown;
82543
+ };
82544
+ content: {
82545
+ "application/json": components["schemas"]["Error"];
82546
+ };
82547
+ };
82548
+ /** @description Rate limited */
82549
+ 429: {
82550
+ headers: {
82551
+ [name: string]: unknown;
82552
+ };
82553
+ content: {
82554
+ "application/json": components["schemas"]["Error"];
82555
+ };
82556
+ };
82557
+ };
82558
+ };
82559
+ options?: never;
82560
+ head?: never;
82561
+ patch?: never;
82562
+ trace?: never;
82563
+ };
82192
82564
  "/ai-agents/{id}/publish-gate": {
82193
82565
  parameters: {
82194
82566
  query?: never;
@@ -82197,8 +82569,8 @@ interface paths {
82197
82569
  cookie?: never;
82198
82570
  };
82199
82571
  /**
82200
- * Would publishing this agent be refused by its evals?
82201
- * @description Reads the agent's ENABLED GOLDEN suite and nothing else.
82572
+ * What the agent's golden suite last said (informational)
82573
+ * @description INFORMATIONAL ONLY since app#3975: publishing never runs, waits on or is blocked by evals. Reads the agent's ENABLED GOLDEN suite and nothing else.
82202
82574
  *
82203
82575
  * - `none` — no enabled golden suite. Never blocks: a workspace that has not opted into gating is not gated.
82204
82576
  * - `pending` — a golden suite run is queued or running. Warn only; blocking here would mean "press publish again in four minutes".
@@ -82208,7 +82580,7 @@ interface paths {
82208
82580
  *
82209
82581
  * `reasons` are stable snake_case codes (`no_golden_suite`, `suite_run_in_flight`, `no_completed_run`, `stale_draft`, `hard_fails`, `pass_rate_below_min`) so the dialog can localize them. `failing` lists the red scenarios of the last completed run with their `run_id`s.
82210
82582
  *
82211
- * `blocked` and `stale` make `POST /ai-agents/{id}/publish` answer **409** `{ error, code: 'evals_blocked' | 'evals_stale', gate }` unless the body carries `force: true`.
82583
+ * `blocked` and `stale` no longer refuse a publish.
82212
82584
  */
82213
82585
  get: {
82214
82586
  parameters: {
@@ -89128,7 +89500,7 @@ interface paths {
89128
89500
  };
89129
89501
  /**
89130
89502
  * Fetch one campaign with its stats
89131
- * @description The campaign plus its delivery counters — this is the read to poll while a send is in progress. A WhatsApp campaign that is not finished also carries `pacing` (ADR 0129): its number’s tier and `limit_per_24h`, `sent_last_24h`, `pending`, `waiting` (a paced campaign waiting for the window) with `next_batch_at`, `estimated_completion_at` and `windows_remaining`, plus the effective `send_window` (`send_window_source`: campaign | workspace), its `window_label` and `next_window_opens_at` (outside the window now); null when the budget cannot be read. With a `send_schedule` (ADR 0139) it also carries `schedule_label`, `next_slot_at`, `batches` (what each slot did: planned / sent / failed / skipped_reason, oldest first) and `schedule` — the pending part simulated slot by slot.
89503
+ * @description The campaign plus its delivery counters — this is the read to poll while a send is in progress. A WhatsApp campaign that is not finished also carries `pacing` (ADR 0129): its number’s tier and `limit_per_24h`, `sent_last_24h`, `pending`, `waiting` (a paced campaign waiting for the window) with `next_batch_at`, `estimated_completion_at` and `windows_remaining`, plus the effective `send_window` (`send_window_source`: campaign | workspace), its `window_label` and `next_window_opens_at` (outside the window now); null when the budget cannot be read. With a `send_schedule` (ADR 0139) it also carries `schedule_label`, `next_slot_at`, `batches` (what each slot did: planned / sent / failed / skipped_reason, oldest first) and `schedule` — the pending part simulated slot by slot. A campaign paused with `paused_reason: delivery_guard` carries `paused_detail` (`sends`, `undeliverable` 131026, `withheld` 131049, `rate` 0-1), computed from the recipients; null otherwise.
89132
89504
  */
89133
89505
  get: {
89134
89506
  parameters: {
@@ -90062,7 +90434,7 @@ interface paths {
90062
90434
  put?: never;
90063
90435
  /**
90064
90436
  * Pause the campaign
90065
- * @description Legal from `sending` and `scheduled`; a 409 otherwise. Stops further delivery — messages already sent are already sent.
90437
+ * @description Legal from `sending` and `scheduled`; a 409 otherwise. Stops further delivery — messages already sent are already sent. A person's pause reads `paused_reason: manual`. The platform also pauses on its own: `messaging_limit` (Meta pushed back; resumes by itself within the hour), `number_quality` (the WhatsApp number's quality turned RED; every sending or scheduled campaign on the number and its WABA siblings stops, and only a person resumes it), `budget_exhausted`, `delivery_guard` (WhatsApp: undeliverable 131026 + withheld 131049 failures passed 10% of the sends, after 50), `pilot`, `schedule_exhausted`, `config_error` and `reputation_guard` (email). Each automatic pause fires the `campaign.paused` webhook.
90066
90438
  */
90067
90439
  post: {
90068
90440
  parameters: {
@@ -90214,6 +90586,8 @@ interface paths {
90214
90586
  *
90215
90587
  * An optional body `{ send_mode }` switches how the rest is sent — e.g. an `asap` campaign the messaging-limit budget paused (`budget_exhausted`) resumed as `paced` continues by itself across the following days. A pilot (`paused_reason: pilot`) resumes into the full send.
90216
90588
  *
90589
+ * **A WhatsApp number whose quality is not GREEN asks for confirmation.** When the stored quality of the campaign's number is YELLOW or RED (or unknown after a `number_quality` pause), a resume without `acknowledge_quality: true` answers 409 with `details: { reason: "number_quality_not_green", quality_rating: "RED" | "YELLOW" | null }` and leaves it paused; with it, the campaign resumes. Nothing resumes a `number_quality` pause automatically.
90590
+ *
90217
90591
  * A 409 if the campaign is not paused. An EMAIL campaign is re-checked against the connected-mailbox rule before it resumes (a mailbox may have been connected, or the sending domain removed, while it was paused): a 422 `CAMPAIGN_FROM_CONNECTED_MAILBOX` leaves it paused.
90218
90592
  */
90219
90593
  post: {
@@ -187679,7 +188053,7 @@ interface components {
187679
188053
  /** @enum {string} */
187680
188054
  kind: "list";
187681
188055
  /** @enum {string} */
187682
- screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals";
188056
+ screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals" | "campaigns";
187683
188057
  filter: {
187684
188058
  [key: string]: string | number | boolean;
187685
188059
  };
@@ -187721,7 +188095,7 @@ interface components {
187721
188095
  /** @enum {string} */
187722
188096
  kind: "list";
187723
188097
  /** @enum {string} */
187724
- screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals";
188098
+ screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals" | "campaigns";
187725
188099
  filter: {
187726
188100
  [key: string]: string | number | boolean;
187727
188101
  };
@@ -187748,7 +188122,7 @@ interface components {
187748
188122
  /** @enum {string} */
187749
188123
  kind: "list";
187750
188124
  /** @enum {string} */
187751
- screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals";
188125
+ screen: "conversations" | "busquedas" | "contacts_demand" | "clinic_call_today" | "clinic_inventory" | "transferencias" | "pipelines" | "price_approvals" | "campaigns";
187752
188126
  filter: {
187753
188127
  [key: string]: string | number | boolean;
187754
188128
  };
@@ -188132,13 +188506,15 @@ interface components {
188132
188506
  conversations: number;
188133
188507
  voice_minutes: number;
188134
188508
  forwarded_voice_minutes: number;
188509
+ /** @description Completed agent-eval runs billed this month (queued after an admin accepted the per-run price). */
188510
+ eval_runs: number;
188135
188511
  email_marketable_contacts: number;
188136
188512
  /** @description Email-campaign messages sent this month; the contact-base line is billed only when above 0. */
188137
188513
  email_marketing_sent: number;
188138
188514
  };
188139
188515
  lines: {
188140
188516
  /** @enum {string} */
188141
- kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188517
+ kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "eval_runs" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188142
188518
  count: number;
188143
188519
  uf_unit: number | null;
188144
188520
  uf_subtotal: number | null;
@@ -188166,9 +188542,10 @@ interface components {
188166
188542
  conversations: number;
188167
188543
  voice_minutes: number;
188168
188544
  forwarded_voice_minutes: number;
188545
+ eval_runs: number;
188169
188546
  lines: {
188170
188547
  /** @enum {string} */
188171
- kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188548
+ kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "eval_runs" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188172
188549
  count: number;
188173
188550
  uf_unit: number | null;
188174
188551
  uf_subtotal: number | null;
@@ -188319,7 +188696,7 @@ interface components {
188319
188696
  days: string[];
188320
188697
  series: {
188321
188698
  /** @enum {string} */
188322
- metric: "conversations" | "voice_minutes" | "forwarded_voice_minutes" | "email_marketing_sent" | "addon_usage";
188699
+ metric: "conversations" | "voice_minutes" | "forwarded_voice_minutes" | "eval_runs" | "email_marketing_sent" | "addon_usage";
188323
188700
  /** @description `addon_usage` only: the add-on feature key. */
188324
188701
  feature: string | null;
188325
188702
  /** @description Σ `values`. */
@@ -188343,7 +188720,7 @@ interface components {
188343
188720
  clp_total: number | null;
188344
188721
  lines: {
188345
188722
  /** @enum {string} */
188346
- kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188723
+ kind: "conversations" | "email_contacts" | "voice_minutes" | "forwarded_voice_minutes" | "eval_runs" | "addon_flat" | "quota_overage" | "contract_fixed" | "conversation_credit" | "manual_credit";
188347
188724
  count: number;
188348
188725
  uf_unit: number | null;
188349
188726
  uf_subtotal: number | null;
@@ -189983,6 +190360,8 @@ interface components {
189983
190360
  * @enum {string}
189984
190361
  */
189985
190362
  send_mode?: "paced" | "asap";
190363
+ /** @description Resume a WhatsApp campaign although its number's quality is not GREEN (YELLOW or RED, or unknown after a `number_quality` pause). Without it such a resume answers 409 with `details.reason: number_quality_not_green` and `details.quality_rating`. */
190364
+ acknowledge_quality?: boolean;
189986
190365
  };
189987
190366
  CampaignRecipient: {
189988
190367
  /** Format: uuid */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "14.47.0",
3
+ "version": "14.49.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",