codai-sdk 0.7.0 → 0.13.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.ts CHANGED
@@ -310,7 +310,7 @@ type paths$1 = {
310
310
  * `voice`, `response_format` (default `mp3`) and `speed` are forwarded without validation — an unsupported value
311
311
  * surfaces as a 502 from upstream. The response body is the raw audio stream; the gateway forwards the upstream
312
312
  * `content-type` and falls back to `audio/mpeg`. Authenticates with a real key or an ephemeral token with
313
- * `scope: audio`. Billing is flat per 1k input characters and never starts a task.
313
+ * `scope: audio` or `scope: live`. Billing is flat per 1k input characters and never starts a task.
314
314
  */
315
315
  readonly post: operations$1['createSpeech'];
316
316
  readonly delete?: never;
@@ -319,6 +319,40 @@ type paths$1 = {
319
319
  readonly patch?: never;
320
320
  readonly trace?: never;
321
321
  };
322
+ readonly '/v1/audio/speech/stream': {
323
+ readonly parameters: {
324
+ readonly query?: never;
325
+ readonly header?: never;
326
+ readonly path?: never;
327
+ readonly cookie?: never;
328
+ };
329
+ readonly get?: never;
330
+ readonly put?: never;
331
+ /**
332
+ * Stream speech with visemes (Azure neural TTS)
333
+ * @description Neural text-to-speech on Azure AI Speech (`codai-tts-ro`), streamed as Server-Sent Events so an avatar can
334
+ * lip-sync while the audio plays. Voices: `alina` → `ro-RO-AlinaNeural` (default), `emil` → `ro-RO-EmilNeural`, or
335
+ * any Azure neural voice name (e.g. `en-US-AvaNeural`). The text is XML-escaped into SSML; `speed` (0.5-2.0) maps
336
+ * to the prosody rate.
337
+ *
338
+ * Events, in order: `start` `{type, model, voice, format, content_type, sample_rate}`; then, interleaved in
339
+ * synthesis order, `audio` `{type, delta}` (base64 chunk — raw PCM16 mono 24 kHz for `pcm`, MP3 frames for `mp3`),
340
+ * `viseme` `{type, id, offsetMs}` (Azure viseme id 0-21) and `word` `{type, text, offsetMs, durationMs}`; finally
341
+ * `done` `{type, audio_ms, audioBytes, visemes, words}` or `error` `{type, error: {code, message}}`. `offsetMs` is
342
+ * measured on the audio timeline from its first sample.
343
+ *
344
+ * Authenticates with a real key or an ephemeral token with `scope: audio` or `scope: live`. Served from an EU
345
+ * Azure region, so EU data-residency accounts may use it. Billing: $16 per 1M input characters, recorded on the
346
+ * usage row when audio was produced; it never starts a task. 503 `tts_unavailable` when Azure Speech is not
347
+ * configured on the gateway.
348
+ */
349
+ readonly post: operations$1['createSpeechStream'];
350
+ readonly delete?: never;
351
+ readonly options?: never;
352
+ readonly head?: never;
353
+ readonly patch?: never;
354
+ readonly trace?: never;
355
+ };
322
356
  readonly '/v1/audio/transcriptions': {
323
357
  readonly parameters: {
324
358
  readonly query?: never;
@@ -419,6 +453,7 @@ type paths$1 = {
419
453
  * (max 120 chars, default `<platform> device`) and the platform from `x-codai-device-platform`
420
454
  * (unknown values fall back to `agent`). An optional `x-codai-push-token` header on those requests upserts the
421
455
  * FCM registration token. The raw push token is never echoed — `has_push_token` is all you get.
456
+ * `online` is `true` when the device was seen in the last 2 minutes.
422
457
  */
423
458
  readonly get: operations$1['listDevices'];
424
459
  readonly put?: never;
@@ -474,6 +509,7 @@ type paths$1 = {
474
509
  * can start without a second lookup. Never lease-gated — drain first, then claim.
475
510
  * Replaces polling `GET /v1/sessions/{id}/controls?target=me` per session. Controls
476
511
  * are capped at `limit` (default 200, max 500) and the global pending scan at 2000 rows.
512
+ * A `mode:"open"` handoff control carries `mode: "open"`: open the session, run nothing.
477
513
  */
478
514
  readonly get: operations$1['getMyDispatchInbox'];
479
515
  readonly put?: never;
@@ -1150,6 +1186,106 @@ type paths$1 = {
1150
1186
  readonly patch?: never;
1151
1187
  readonly trace?: never;
1152
1188
  };
1189
+ readonly '/v1/images/edits': {
1190
+ readonly parameters: {
1191
+ readonly query?: never;
1192
+ readonly header?: never;
1193
+ readonly path?: never;
1194
+ readonly cookie?: never;
1195
+ };
1196
+ readonly get?: never;
1197
+ readonly put?: never;
1198
+ /**
1199
+ * Edit images
1200
+ * @description Edit or vary one or more input images from a text instruction, on the same models, auth, allow-list,
1201
+ * spend caps and billing as `POST /v1/images/generations`. The input images (1–14; `codai-image-fast`
1202
+ * accepts 4) are sent to the model before the prompt; describe the change in `prompt` ("replace the
1203
+ * background with a sunset, keep the logo unchanged").
1204
+ *
1205
+ * Send JSON (`image` is one object or an array of `{b64_json, mime_type}`) or `multipart/form-data`
1206
+ * OpenAI-style, with the file in `image` (or `image[]`, repeatable). `mask` is not supported and returns
1207
+ * 400 — describe the region to change in the prompt instead. Input images are billed as input tokens at
1208
+ * the model's rate.
1209
+ */
1210
+ readonly post: operations$1['editImage'];
1211
+ readonly delete?: never;
1212
+ readonly options?: never;
1213
+ readonly head?: never;
1214
+ readonly patch?: never;
1215
+ readonly trace?: never;
1216
+ };
1217
+ readonly '/v1/images/generations': {
1218
+ readonly parameters: {
1219
+ readonly query?: never;
1220
+ readonly header?: never;
1221
+ readonly path?: never;
1222
+ readonly cookie?: never;
1223
+ };
1224
+ readonly get?: never;
1225
+ readonly put?: never;
1226
+ /**
1227
+ * Generate images
1228
+ * @description OpenAI-compatible image generation backed by the Google Gemini image family on Vertex AI. Public ids:
1229
+ * `codai-image` (default → `gemini-3.1-flash-image`, served from the Vertex `eu` multi-region, so prompts and
1230
+ * images are processed in the EU), `codai-image-fast` (→ `gemini-3.1-flash-lite-image`, `global`) and
1231
+ * `codai-image-pro` (→ `gemini-3-pro-image`, `global`); the raw registry ids are accepted too. The retired ids
1232
+ * `gemini-2.5-flash-image` (shut down by Google on 2026-10-02), `imagen-4` and `imagen-4-fast` are served as
1233
+ * `codai-image`. Authenticates with a real API key only — ephemeral tokens are rejected. The per-key model
1234
+ * allow-list applies; image models are implicitly granted wherever `codai` or `codai-image` is.
1235
+ *
1236
+ * Brand consistency: `reference_images` (up to 14; `codai-image-fast` accepts 4) are sent to the model as
1237
+ * inline images before the prompt, so a logo, palette or product stays intact across generations. To edit an
1238
+ * existing image use `POST /v1/images/edits`.
1239
+ *
1240
+ * Images are returned inline as base64 (`response_format: b64_json`); `url` is rejected with 400 because the
1241
+ * gateway does not host images. `aspect_ratio` sets the shape directly; otherwise `size` maps to one
1242
+ * (1024x1024 → 1:1, 1536x1024 → 3:2, 1024x1536 → 2:3, 1792x1024 → 16:9, 1024x1792 → 9:16). `image_size`
1243
+ * picks the resolution (`512`, `1K`, `2K`, `4K`; default `1K`; `codai-image` supports all four,
1244
+ * `codai-image-fast` only `1K`, `codai-image-pro` `1K`/`2K`/`4K`). The model returns one image per call, so
1245
+ * `n` > 1 is n parallel calls. When the upstream safety filter drops every image the response is 400 with
1246
+ * code `content_filtered` and nothing is charged.
1247
+ *
1248
+ * Images from the EU endpoint carry C2PA content credentials (a `caBX` chunk) and a SynthID watermark. Store
1249
+ * the bytes as returned — re-encoding or resizing strips the C2PA manifest.
1250
+ *
1251
+ * Billing is computed from the token usage the model reports, at the Vertex rates of the resolved model
1252
+ * (a default 1K image ≈ $0.074 on `codai-image`, ≈ $0.034 on `codai-image-fast`, ≈ $0.134 on
1253
+ * `codai-image-pro`; higher resolutions and reference images cost more). The charge is disclosed in
1254
+ * `x-codai-cost-micro-usd`, recorded as `usage_events.cost_micro_usd`, counted toward the daily and monthly
1255
+ * spend caps, and debited from the prepaid EUR wallet. Only images actually returned are charged. Image
1256
+ * calls never start a task. Typical latency is 5–30 s; the upstream timeout is 120 s.
1257
+ */
1258
+ readonly post: operations$1['createImage'];
1259
+ readonly delete?: never;
1260
+ readonly options?: never;
1261
+ readonly head?: never;
1262
+ readonly patch?: never;
1263
+ readonly trace?: never;
1264
+ };
1265
+ readonly '/v1/keys/self/revoke': {
1266
+ readonly parameters: {
1267
+ readonly query?: never;
1268
+ readonly header?: never;
1269
+ readonly path?: never;
1270
+ readonly cookie?: never;
1271
+ };
1272
+ readonly get?: never;
1273
+ readonly put?: never;
1274
+ /**
1275
+ * Revoke the calling API key (sign out)
1276
+ * @description The API key that authenticates this request revokes itself: it stops working at once on the instance that
1277
+ * served the call and within 60 seconds everywhere (principal cache TTL). Only the calling key is affected,
1278
+ * never another key of the same account. Clients call it on "Sign out" so a copied key cannot keep working.
1279
+ * A key that is already revoked fails authentication with 401, which a client can treat as "already signed
1280
+ * out". `revoked` is `false` only when a concurrent revoke won the race.
1281
+ */
1282
+ readonly post: operations$1['revokeSelfKey'];
1283
+ readonly delete?: never;
1284
+ readonly options?: never;
1285
+ readonly head?: never;
1286
+ readonly patch?: never;
1287
+ readonly trace?: never;
1288
+ };
1153
1289
  readonly '/v1/messages': {
1154
1290
  readonly parameters: {
1155
1291
  readonly query?: never;
@@ -1479,6 +1615,78 @@ type paths$1 = {
1479
1615
  readonly patch: operations$1['updateProject'];
1480
1616
  readonly trace?: never;
1481
1617
  };
1618
+ readonly '/v1/prompts': {
1619
+ readonly parameters: {
1620
+ readonly query?: never;
1621
+ readonly header?: never;
1622
+ readonly path?: never;
1623
+ readonly cookie?: never;
1624
+ };
1625
+ /**
1626
+ * List pending prompts
1627
+ * @description Your prompts, soonest `not_before` first (prompts without one lead), then newest. `status=due` returns open prompts whose `not_before` is empty or already passed; `all` returns every status.
1628
+ */
1629
+ readonly get: operations$1['listPrompts'];
1630
+ readonly put?: never;
1631
+ /**
1632
+ * Save a prompt for later
1633
+ * @description Idempotent on the prompt text: posting the same text again returns the existing prompt with `200` and `created: false`. With `goal_key`, older open prompts carrying the same key become `superseded` (count in `superseded`). `not_before` accepts an ISO datetime or a bare `YYYY-MM-DD` (07:00 UTC that day).
1634
+ */
1635
+ readonly post: operations$1['createPrompt'];
1636
+ readonly delete?: never;
1637
+ readonly options?: never;
1638
+ readonly head?: never;
1639
+ readonly patch?: never;
1640
+ readonly trace?: never;
1641
+ };
1642
+ readonly '/v1/prompts/{id}': {
1643
+ readonly parameters: {
1644
+ readonly query?: never;
1645
+ readonly header?: never;
1646
+ readonly path?: never;
1647
+ readonly cookie?: never;
1648
+ };
1649
+ /**
1650
+ * Get a prompt
1651
+ * @description One of your prompts, including its full text.
1652
+ */
1653
+ readonly get: operations$1['getPrompt'];
1654
+ readonly put?: never;
1655
+ readonly post?: never;
1656
+ /**
1657
+ * Delete a prompt
1658
+ * @description Deletes one of your prompts. Unknown, malformed or foreign ids are not an error: the response is `200` with `deleted: 0`.
1659
+ */
1660
+ readonly delete: operations$1['deletePrompt'];
1661
+ readonly options?: never;
1662
+ readonly head?: never;
1663
+ /**
1664
+ * Edit, snooze or close a prompt
1665
+ * @description Changes any subset of the fields (at least one). Setting `not_before` re-arms the due reminder (snooze); `status` `done` or `dismissed` stamps `done_at`, any other status clears it. Editing `prompt` to a text another prompt of yours already has is `400`.
1666
+ */
1667
+ readonly patch: operations$1['updatePrompt'];
1668
+ readonly trace?: never;
1669
+ };
1670
+ readonly '/v1/prompts/{id}/launch': {
1671
+ readonly parameters: {
1672
+ readonly query?: never;
1673
+ readonly header?: never;
1674
+ readonly path?: never;
1675
+ readonly cookie?: never;
1676
+ };
1677
+ readonly get?: never;
1678
+ readonly put?: never;
1679
+ /**
1680
+ * Start a chat from a prompt
1681
+ * @description Opens a new shared session and sends the prompt text to a device as a `send` control (queued when the device is offline, woken by push when it has a token). The device is `device_id`, else the prompt `target_device_id`, else your freshest desktop/Android device; with none available the call is `400`. The prompt moves to `launched` with `run_session_id` set.
1682
+ */
1683
+ readonly post: operations$1['launchPrompt'];
1684
+ readonly delete?: never;
1685
+ readonly options?: never;
1686
+ readonly head?: never;
1687
+ readonly patch?: never;
1688
+ readonly trace?: never;
1689
+ };
1482
1690
  readonly '/v1/receipt': {
1483
1691
  readonly parameters: {
1484
1692
  readonly query?: never;
@@ -1703,7 +1911,7 @@ type paths$1 = {
1703
1911
  * (`applied=false`) in insertion order, at most 500. `target=me` narrows to controls
1704
1912
  * dispatched at the calling device (needs `x-codai-device`, else `400`); an explicit
1705
1913
  * device UUID is accepted too. `target_device_id` is `null` for plain controls and set
1706
- * only for Dispatch-originated ones.
1914
+ * only for Dispatch-originated ones; a `mode:"open"` handoff also carries `mode: "open"`.
1707
1915
  */
1708
1916
  readonly get: operations$1['listSessionControls'];
1709
1917
  readonly put?: never;
@@ -1727,7 +1935,7 @@ type paths$1 = {
1727
1935
  readonly get?: never;
1728
1936
  readonly put?: never;
1729
1937
  /**
1730
- * Queue a `send` for one device and wake it over FCM
1938
+ * Queue a `send` (or an `open` handoff) for one device and wake it over FCM
1731
1939
  * @description Requires `editor` or higher. The target must be a device of the session OWNER
1732
1940
  * (only owner devices can hold the lease), otherwise `404`. Persists a `send` control
1733
1941
  * carrying `target_device_id` (idempotent on `control_id`; server-generated
@@ -1736,6 +1944,12 @@ type paths$1 = {
1736
1944
  * open: the control is durable regardless and is drained by the target's next
1737
1945
  * `GET …/controls?target=me` or `GET /v1/devices/me/dispatch`. The executor lease is
1738
1946
  * not touched — the woken device claims (or force-claims) it itself.
1947
+ *
1948
+ * `mode` (default `send`) picks what the target does. `send` requires `text` and runs
1949
+ * it as a new turn. `open` is a handoff: the target only opens the session — `text`
1950
+ * and `turn_id` are ignored, no user turn is created, the queued control is a text-less
1951
+ * `send` listed with `mode: "open"` (and the FCM data carries `mode: "open"`), and the
1952
+ * target may mark it applied without holding the executor lease.
1739
1953
  */
1740
1954
  readonly post: operations$1['dispatchToDevice'];
1741
1955
  readonly delete?: never;
@@ -1961,6 +2175,17 @@ type paths$1 = {
1961
2175
  * When codai-s1 is disabled, down or over budget the gateway answers **503 `s1_unavailable`**
1962
2176
  * and never substitutes a generative model: keep your own fallback. Usage is recorded as
1963
2177
  * `codai-s1` and never starts a task.
2178
+ *
2179
+ * **Batch.** Send `items: [{id, state}]` (1-16, unique ids) instead of `state` to ask the same
2180
+ * `questions` about several states in one call; items run concurrently and the response carries
2181
+ * `items: [{id, answers}]` in request order with summed `usage`. A batch is all-or-nothing.
2182
+ * `timeout_ms` (100-5000) overrides the gateway's default s1 budget for this call.
2183
+ *
2184
+ * **Opt-in fallback.** With `fallback: "codai-fast"` an unavailable codai-s1 is answered by
2185
+ * codai-fast through structured output: same answer shapes, but probabilities come from a
2186
+ * generative model (less calibrated), `model` is `codai-fast`, `fallback_used` is `true` and the
2187
+ * `x-codai-s1-fallback: codai-fast` header is set. If the fallback also fails the answer is still
2188
+ * 503 `s1_unavailable`. Omit `fallback` (or send `none`) to keep the strict contract.
1964
2189
  */
1965
2190
  readonly post: operations$1['createSystemOne'];
1966
2191
  readonly delete?: never;
@@ -2098,7 +2323,8 @@ type paths$1 = {
2098
2323
  /**
2099
2324
  * Mint an ephemeral scoped token
2100
2325
  * @description Mints a short-lived, stateless HMAC token (`codai_eph_v1.<payload>.<signature>`) bound to ONE surface —
2101
- * `realtime`, `audio` or `embeddings` — for the key that calls this endpoint. Servers call it and hand the token
2326
+ * `realtime`, `audio` or `embeddings` — or to the `live` bundle (realtime + audio: one token for a live co-host's
2327
+ * speech-to-text and text-to-speech) for the key that calls this endpoint. Servers call it and hand the token
2102
2328
  * to a browser or webview instead of the raw workspace key: a leaked token exposes at most one media surface for
2103
2329
  * at most one hour. `ttl_seconds` is clamped to 60–3600 and defaults to 600.
2104
2330
  *
@@ -2316,6 +2542,52 @@ type paths$1 = {
2316
2542
  readonly patch?: never;
2317
2543
  readonly trace?: never;
2318
2544
  };
2545
+ readonly '/v1/verify/agent-output': {
2546
+ readonly parameters: {
2547
+ readonly query?: never;
2548
+ readonly header?: never;
2549
+ readonly path?: never;
2550
+ readonly cookie?: never;
2551
+ };
2552
+ readonly get?: never;
2553
+ readonly put?: never;
2554
+ /**
2555
+ * Verify a signed agent output (experimental)
2556
+ * @description **Experimental, unaudited (HIDE protocol).** Checks an `output_signature` against the signed payload
2557
+ * `{ v: 1, task_id, environment_id, user_id, status, result, finished_at }` rebuilt from the task object.
2558
+ * Provenance only; never authentication. A `key_id` that is not the current key answers
2559
+ * `{ valid: false, reason: unknown_key }`. Stateless, body capped at 256 KiB. Unauthenticated.
2560
+ */
2561
+ readonly post: operations$1['verifyAgentOutput'];
2562
+ readonly delete?: never;
2563
+ readonly options?: never;
2564
+ readonly head?: never;
2565
+ readonly patch?: never;
2566
+ readonly trace?: never;
2567
+ };
2568
+ readonly '/v1/verify/agent-output/key': {
2569
+ readonly parameters: {
2570
+ readonly query?: never;
2571
+ readonly header?: never;
2572
+ readonly path?: never;
2573
+ readonly cookie?: never;
2574
+ };
2575
+ /**
2576
+ * Public key for agent-output signatures (experimental)
2577
+ * @description **Experimental, unaudited (HIDE protocol).** Returns the gateway's current public key for the
2578
+ * `output_signature` carried by finished agent tasks, so you can verify signatures offline. A signature proves
2579
+ * provenance of the output only; it is never an authentication mechanism. `{ enabled: false }` when output
2580
+ * signing is not configured on this deployment. Unauthenticated.
2581
+ */
2582
+ readonly get: operations$1['getAgentOutputKey'];
2583
+ readonly put?: never;
2584
+ readonly post?: never;
2585
+ readonly delete?: never;
2586
+ readonly options?: never;
2587
+ readonly head?: never;
2588
+ readonly patch?: never;
2589
+ readonly trace?: never;
2590
+ };
2319
2591
  };
2320
2592
  type components$1 = {
2321
2593
  schemas: {
@@ -2670,6 +2942,39 @@ type components$1 = {
2670
2942
  /** @enum {string} */
2671
2943
  readonly source: 'welcome_grant' | 'referral_referee_grant' | 'referral_referrer_grant' | 'promo_grant' | 'admin_grant' | 'admin_revoke' | 'purchase' | 'usage_charge' | 'expiry' | 'auto_topup' | 'task_refund' | 'task_success_charge' | 'credit_migration' | 'compute_charge';
2672
2944
  };
2945
+ /** Agent output signing key (experimental) */
2946
+ readonly AgentOutputKey: {
2947
+ /** @example hide-hybrid-ed25519-mldsa65 */
2948
+ readonly alg?: string;
2949
+ /** @example codai.agent-output.v1 */
2950
+ readonly context?: string;
2951
+ /** @description `false` when output signing is not configured; the other key fields are then absent. */
2952
+ readonly enabled: boolean;
2953
+ readonly key_id?: string;
2954
+ readonly note: string;
2955
+ /** @description Base64 hybrid public key. */
2956
+ readonly public_key?: string;
2957
+ };
2958
+ /** Verify agent output */
2959
+ readonly AgentOutputVerifyRequest: {
2960
+ /** @description The signed payload `{ v: 1, task_id, environment_id, user_id, status, result, finished_at }`. */
2961
+ readonly payload: {
2962
+ readonly [key: string]: unknown;
2963
+ };
2964
+ readonly signature: {
2965
+ readonly key_id?: string;
2966
+ readonly sig: string;
2967
+ };
2968
+ };
2969
+ /** Agent output verification result */
2970
+ readonly AgentOutputVerifyResult: {
2971
+ /** @description Id of the gateway key the check ran against. */
2972
+ readonly key_id: string;
2973
+ readonly note: string;
2974
+ /** @enum {string} */
2975
+ readonly reason?: 'unknown_key';
2976
+ readonly valid: boolean;
2977
+ };
2673
2978
  /**
2674
2979
  * Agent run
2675
2980
  * @description Poll view of a persisted run (`GET /v1/agents/runs/{id}`).
@@ -3256,6 +3561,153 @@ type components$1 = {
3256
3561
  readonly ok?: boolean;
3257
3562
  };
3258
3563
  };
3564
+ /**
3565
+ * Image aspect ratio
3566
+ * @description Output aspect ratio. Overrides `size`.
3567
+ * @enum {string}
3568
+ */
3569
+ readonly CoreImageAspectRatio: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' | '9:21' | '1:4' | '4:1' | '1:8' | '8:1';
3570
+ /** Generated image */
3571
+ readonly CoreImageData: {
3572
+ /** @description The image bytes, base64-encoded. Keep them as returned — re-encoding strips the C2PA manifest. */
3573
+ readonly b64_json: string;
3574
+ /**
3575
+ * @description MIME type of the image bytes (usually `image/png`).
3576
+ * @example image/png
3577
+ */
3578
+ readonly mime_type?: string;
3579
+ };
3580
+ /**
3581
+ * Image edit form
3582
+ * @description OpenAI-style multipart form for `POST /v1/images/edits`. `mask` is rejected with 400.
3583
+ */
3584
+ readonly CoreImageEditForm: {
3585
+ readonly aspect_ratio?: components$1['schemas']['CoreImageAspectRatio'];
3586
+ /** @description Input image file(s); the field may also be named `image[]` and repeated. */
3587
+ readonly image: readonly string[];
3588
+ readonly image_size?: components$1['schemas']['CoreImageSize'];
3589
+ /**
3590
+ * @description Image model, same ids as the JSON body.
3591
+ * @default codai-image
3592
+ */
3593
+ readonly model?: string;
3594
+ /** @default 1 */
3595
+ readonly n?: number;
3596
+ readonly negative_prompt?: string;
3597
+ /** @description The edit to apply, in words. */
3598
+ readonly prompt: string;
3599
+ /** @enum {string} */
3600
+ readonly response_format?: 'b64_json';
3601
+ /** @description OpenAI-style size, mapped to an aspect ratio. */
3602
+ readonly size?: string;
3603
+ };
3604
+ /**
3605
+ * Image edit request
3606
+ * @description JSON body for `POST /v1/images/edits`. Unknown fields are accepted and ignored.
3607
+ */
3608
+ readonly CoreImageEditRequest: {
3609
+ readonly aspect_ratio?: components$1['schemas']['CoreImageAspectRatio'];
3610
+ /** @description One input image, or up to 14 (per-model limit; `codai-image-fast` accepts 4). */
3611
+ readonly image: components$1['schemas']['CoreImageInput'] | readonly components$1['schemas']['CoreImageInput'][];
3612
+ readonly image_size?: components$1['schemas']['CoreImageSize'];
3613
+ /**
3614
+ * @description Image model, same ids as `POST /v1/images/generations`.
3615
+ * @default codai-image
3616
+ * @enum {string}
3617
+ */
3618
+ readonly model?: 'codai-image' | 'codai-image-fast' | 'codai-image-pro' | 'gemini-3.1-flash-image' | 'gemini-3.1-flash-lite-image' | 'gemini-3-pro-image' | 'gemini-2.5-flash-image' | 'imagen-4' | 'imagen-4-fast';
3619
+ /**
3620
+ * @description Number of edited images to return.
3621
+ * @default 1
3622
+ */
3623
+ readonly n?: number;
3624
+ /** @description What the result should not contain; appended to the prompt as an exclusion. */
3625
+ readonly negative_prompt?: string;
3626
+ /**
3627
+ * @description The edit to apply, in words (what to change and what to keep).
3628
+ * @example replace the background with a soft sunset gradient, keep the logo unchanged
3629
+ */
3630
+ readonly prompt: string;
3631
+ /**
3632
+ * @description Only `b64_json` is supported.
3633
+ * @enum {string}
3634
+ */
3635
+ readonly response_format?: 'b64_json';
3636
+ /**
3637
+ * @description OpenAI-style size, mapped to an aspect ratio. Ignored when `aspect_ratio` is set.
3638
+ * @enum {string}
3639
+ */
3640
+ readonly size?: '1024x1024' | '1536x1024' | '1024x1536' | '1792x1024' | '1024x1792';
3641
+ } & {
3642
+ readonly [key: string]: unknown;
3643
+ };
3644
+ /** Input image */
3645
+ readonly CoreImageInput: {
3646
+ /** @description The image bytes, base64-encoded (at most 7 MB decoded). */
3647
+ readonly b64_json: string;
3648
+ /**
3649
+ * @description MIME type of the image bytes.
3650
+ * @default image/png
3651
+ * @enum {string}
3652
+ */
3653
+ readonly mime_type?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/heic' | 'image/heif';
3654
+ };
3655
+ /**
3656
+ * Image resolution
3657
+ * @description Output resolution. `codai-image` supports all four, `codai-image-fast` only `1K`, `codai-image-pro` `1K`, `2K` and `4K`; an unsupported value is 400.
3658
+ * @default 1K
3659
+ * @enum {string}
3660
+ */
3661
+ readonly CoreImageSize: '512' | '1K' | '2K' | '4K';
3662
+ /**
3663
+ * Image generation request
3664
+ * @description OpenAI-compatible image generation body. Unknown fields are accepted and ignored.
3665
+ */
3666
+ readonly CoreImagesRequest: {
3667
+ readonly aspect_ratio?: components$1['schemas']['CoreImageAspectRatio'];
3668
+ readonly image_size?: components$1['schemas']['CoreImageSize'];
3669
+ /**
3670
+ * @description Image model. `codai-image` → `gemini-3.1-flash-image` (EU), `codai-image-fast` → `gemini-3.1-flash-lite-image`, `codai-image-pro` → `gemini-3-pro-image`. `gemini-2.5-flash-image`, `imagen-4` and `imagen-4-fast` are retired upstream and served as `codai-image`.
3671
+ * @default codai-image
3672
+ * @enum {string}
3673
+ */
3674
+ readonly model?: 'codai-image' | 'codai-image-fast' | 'codai-image-pro' | 'gemini-3.1-flash-image' | 'gemini-3.1-flash-lite-image' | 'gemini-3-pro-image' | 'gemini-2.5-flash-image' | 'imagen-4' | 'imagen-4-fast';
3675
+ /**
3676
+ * @description Number of images to generate.
3677
+ * @default 1
3678
+ */
3679
+ readonly n?: number;
3680
+ /** @description What the image should not contain; appended to the prompt as an exclusion. */
3681
+ readonly negative_prompt?: string;
3682
+ /**
3683
+ * @description Text description of the image to generate.
3684
+ * @example flat minimalist logo of a paper plane, two colours, white background
3685
+ */
3686
+ readonly prompt: string;
3687
+ /** @description Images the model must stay consistent with (logo, palette, product, character), sent before the prompt. Per-model limit — `codai-image-fast` accepts 4, the others 14. */
3688
+ readonly reference_images?: readonly components$1['schemas']['CoreImageInput'][];
3689
+ /**
3690
+ * @description Only `b64_json` is supported; `url` is rejected because the gateway does not host images.
3691
+ * @enum {string}
3692
+ */
3693
+ readonly response_format?: 'b64_json';
3694
+ /**
3695
+ * @description OpenAI-style size, mapped to an aspect ratio (1:1, 3:2, 2:3, 16:9, 9:16). Ignored when `aspect_ratio` is set.
3696
+ * @default 1024x1024
3697
+ * @enum {string}
3698
+ */
3699
+ readonly size?: '1024x1024' | '1536x1024' | '1024x1536' | '1792x1024' | '1024x1792';
3700
+ /** @description OpenAI tracking field; accepted and ignored. */
3701
+ readonly user?: string;
3702
+ } & {
3703
+ readonly [key: string]: unknown;
3704
+ };
3705
+ /** Image generation response */
3706
+ readonly CoreImagesResponse: {
3707
+ /** @description Unix timestamp (seconds) of when the images were generated. */
3708
+ readonly created: number;
3709
+ readonly data: readonly components$1['schemas']['CoreImageData'][];
3710
+ };
3259
3711
  /** Model */
3260
3712
  readonly CoreModel: {
3261
3713
  /** @description Non-OpenAI extension with routing and capability flags. */
@@ -3400,7 +3852,7 @@ type components$1 = {
3400
3852
  /** Ephemeral token request */
3401
3853
  readonly CoreTokenRequest: {
3402
3854
  /**
3403
- * @description Surface the token may reach. Only `realtime`, `audio` and `embeddings` are accepted; anything else is 400.
3855
+ * @description Surface the token may reach. Only `realtime`, `audio`, `embeddings` and `live` (realtime + audio) are accepted; anything else is 400.
3404
3856
  * @example realtime
3405
3857
  */
3406
3858
  readonly scope: string;
@@ -3419,7 +3871,7 @@ type components$1 = {
3419
3871
  */
3420
3872
  readonly expires_at: string;
3421
3873
  /** @enum {string} */
3422
- readonly scope: 'realtime' | 'audio' | 'embeddings';
3874
+ readonly scope: 'realtime' | 'audio' | 'embeddings' | 'live';
3423
3875
  /**
3424
3876
  * @description Bearer credential of the form `codai_eph_v1.<payload>.<signature>`. Pass it as `Authorization: Bearer` or as `?key=` on `/v1/realtime`.
3425
3877
  * @example codai_eph_v1.eyJraWQiOiIuLi4ifQ.c2lnbmF0dXJl
@@ -3516,6 +3968,8 @@ type components$1 = {
3516
3968
  * @example Pixel 9 Pro
3517
3969
  */
3518
3970
  readonly name: string;
3971
+ /** @description `true` when `lastSeenAt` is within the last 2 minutes (any request carrying this device id bumps it). A future `lastSeenAt` (clock skew) counts as online. */
3972
+ readonly online: boolean;
3519
3973
  readonly platform: components$1['schemas']['DevicePlatform'];
3520
3974
  };
3521
3975
  /**
@@ -3808,7 +4262,7 @@ type components$1 = {
3808
4262
  readonly visibility: components$1['schemas']['PortVisibility'];
3809
4263
  };
3810
4264
  /**
3811
- * @description `byo` (bring your own machine; the daemon enrols with a token) is open to every key. `openstack` / `hetzner` are managed by the worker and billed hourly; `gce` is the GPU provider (size `gpu-l4`, Spot, 30-minute cap), available only where the deployment enables it; `local` is a developer convenience. Managed providers answer 403 until enabled for your key.
4265
+ * @description `byo` (bring your own machine; the daemon enrols with a token) is open to every key. `openstack` / `hetzner` are managed by the worker and billed hourly; `gce` (Google Cloud) offers on-demand CPU sizes `small`/`medium`/`large` (e2-standard-2/4/8) and the GPU size `gpu-l4` (Spot, 30-minute cap); it is available only where the deployment enables it AND to `super_admin` accounts (403 for everyone else); `local` is a developer convenience. Managed providers answer 403 until enabled for your key.
3812
4266
  * @enum {string}
3813
4267
  */
3814
4268
  readonly EnvironmentProvider: 'byo' | 'openstack' | 'hetzner' | 'local' | 'gce';
@@ -3893,6 +4347,12 @@ type components$1 = {
3893
4347
  readonly finished_at: string | null;
3894
4348
  /** Format: uuid */
3895
4349
  readonly id: string;
4350
+ /**
4351
+ * @description **Experimental, unaudited (HIDE protocol).** Gateway signature of the finished output, `null` while the
4352
+ * task runs or when signing is disabled. Provenance only, never authentication; verify with
4353
+ * `POST /v1/verify/agent-output`.
4354
+ */
4355
+ readonly output_signature: components$1['schemas']['EnvironmentTaskOutputSignature'] | null;
3896
4356
  readonly prompt: string;
3897
4357
  /** @description Filled when the task finishes; every field may be null. */
3898
4358
  readonly result: {
@@ -3927,6 +4387,19 @@ type components$1 = {
3927
4387
  /** @description What the agent should do (1..20000 characters). */
3928
4388
  readonly prompt: string;
3929
4389
  };
4390
+ /** Agent output signature (experimental) */
4391
+ readonly EnvironmentTaskOutputSignature: {
4392
+ /** @example hide-hybrid-ed25519-mldsa65 */
4393
+ readonly alg: string;
4394
+ /** @example codai.agent-output.v1 */
4395
+ readonly context: string;
4396
+ /** @description 16 hex characters identifying the signing key. */
4397
+ readonly key_id: string;
4398
+ /** @description Base64 hybrid signature. */
4399
+ readonly sig: string;
4400
+ /** Format: date-time */
4401
+ readonly signed_at: string;
4402
+ };
3930
4403
  /** Queued task */
3931
4404
  readonly EnvironmentTaskQueued: {
3932
4405
  /**
@@ -4579,26 +5052,108 @@ type components$1 = {
4579
5052
  /** Format: uri */
4580
5053
  readonly repo_url?: string | null;
4581
5054
  };
4582
- /**
4583
- * Attached client (relay)
4584
- * @description A device or agent socket attached to the environment, on any relay instance.
4585
- */
4586
- readonly RelayAttachedClient: {
5055
+ /** @description A pending prompt. Timestamps are ISO strings or `null`. */
5056
+ readonly Prompt: {
5057
+ readonly auto_run: boolean;
4587
5058
  /** Format: date-time */
4588
- readonly attached_at: string;
4589
- readonly client_id: string;
4590
- readonly device_id: string | null;
4591
- /** @enum {string} */
4592
- readonly kind: 'device' | 'agent';
4593
- readonly name: string | null;
4594
- readonly platform: string | null;
4595
- readonly role: components$1['schemas']['EnvironmentRole'];
4596
- readonly user_id: string;
4597
- };
4598
- /**
4599
- * Relay environment status
4600
- * @description What the relay knows about the daemon of an environment. Detail fields are `null`/empty unless the daemon's socket is on the answering instance.
4601
- */
5059
+ readonly created_at: string;
5060
+ /** Format: date-time */
5061
+ readonly done_at: string | null;
5062
+ readonly goal_key: string | null;
5063
+ /** Format: uuid */
5064
+ readonly id: string;
5065
+ /** Format: date-time */
5066
+ readonly launched_at: string | null;
5067
+ /**
5068
+ * Format: date-time
5069
+ * @description The prompt is due from this moment on.
5070
+ */
5071
+ readonly not_before: string | null;
5072
+ /**
5073
+ * Format: date-time
5074
+ * @description When the due reminder was sent.
5075
+ */
5076
+ readonly notified_at: string | null;
5077
+ readonly origin: {
5078
+ readonly [key: string]: unknown;
5079
+ };
5080
+ readonly prompt: string;
5081
+ readonly repo: string | null;
5082
+ /** Format: uuid */
5083
+ readonly run_session_id: string | null;
5084
+ readonly source: components$1['schemas']['PromptSource'];
5085
+ readonly status: components$1['schemas']['PromptStatus'];
5086
+ /** Format: uuid */
5087
+ readonly target_device_id: string | null;
5088
+ /** @description Defaults to the first line of the prompt (max 120 chars). */
5089
+ readonly title: string;
5090
+ readonly tracker: string | null;
5091
+ /** Format: date-time */
5092
+ readonly updated_at: string;
5093
+ };
5094
+ readonly PromptCreate: {
5095
+ /**
5096
+ * @description Launch automatically when due.
5097
+ * @default false
5098
+ */
5099
+ readonly auto_run?: boolean;
5100
+ /** @description Stable key of the goal; a new prompt supersedes older open ones with the same key. */
5101
+ readonly goal_key?: string;
5102
+ /** @description ISO datetime with offset, or `YYYY-MM-DD` (07:00 UTC). `null` = due immediately. */
5103
+ readonly not_before?: string | null;
5104
+ /** @description Free-form capture metadata (session, transcript, host). */
5105
+ readonly origin?: {
5106
+ readonly [key: string]: unknown;
5107
+ };
5108
+ readonly prompt: string;
5109
+ readonly repo?: string;
5110
+ readonly source?: components$1['schemas']['PromptSource'];
5111
+ /** Format: uuid */
5112
+ readonly target_device_id?: string | null;
5113
+ readonly title?: string;
5114
+ readonly tracker?: string;
5115
+ };
5116
+ readonly PromptCreated: components$1['schemas']['Prompt'] & {
5117
+ /** @description `false` when the same text already existed. */
5118
+ readonly created: boolean;
5119
+ /** @description Older open prompts with the same `goal_key` now `superseded`. */
5120
+ readonly superseded: number;
5121
+ };
5122
+ readonly PromptPatch: {
5123
+ readonly auto_run?: boolean;
5124
+ /** @description ISO datetime with offset, or `YYYY-MM-DD` (07:00 UTC). `null` = due immediately. */
5125
+ readonly not_before?: string | null;
5126
+ readonly prompt?: string;
5127
+ readonly status?: components$1['schemas']['PromptStatus'];
5128
+ /** Format: uuid */
5129
+ readonly target_device_id?: string | null;
5130
+ readonly title?: string;
5131
+ readonly tracker?: string | null;
5132
+ };
5133
+ /** @enum {string} */
5134
+ readonly PromptSource: 'vscode' | 'cli' | 'desktop' | 'phone' | 'agent' | 'hub' | 'manual';
5135
+ /** @enum {string} */
5136
+ readonly PromptStatus: 'open' | 'launched' | 'done' | 'dismissed' | 'superseded';
5137
+ /**
5138
+ * Attached client (relay)
5139
+ * @description A device or agent socket attached to the environment, on any relay instance.
5140
+ */
5141
+ readonly RelayAttachedClient: {
5142
+ /** Format: date-time */
5143
+ readonly attached_at: string;
5144
+ readonly client_id: string;
5145
+ readonly device_id: string | null;
5146
+ /** @enum {string} */
5147
+ readonly kind: 'device' | 'agent';
5148
+ readonly name: string | null;
5149
+ readonly platform: string | null;
5150
+ readonly role: components$1['schemas']['EnvironmentRole'];
5151
+ readonly user_id: string;
5152
+ };
5153
+ /**
5154
+ * Relay environment status
5155
+ * @description What the relay knows about the daemon of an environment. Detail fields are `null`/empty unless the daemon's socket is on the answering instance.
5156
+ */
4602
5157
  readonly RelayEnvironmentStatus: {
4603
5158
  /** @enum {string|null} */
4604
5159
  readonly activity: 'idle' | 'human' | 'agent' | null;
@@ -4700,6 +5255,11 @@ type components$1 = {
4700
5255
  readonly from_device_id: string;
4701
5256
  readonly id: string;
4702
5257
  readonly kind: components$1['schemas']['SessionControlKind'];
5258
+ /**
5259
+ * @description Present (`open`) only on a `mode:"open"` Dispatch handoff — open the session, run nothing. Absent on every other control.
5260
+ * @enum {string}
5261
+ */
5262
+ readonly mode?: 'open';
4703
5263
  /** @description Seq of the echoed `control` event. */
4704
5264
  readonly seq: number | null;
4705
5265
  /**
@@ -4777,13 +5337,26 @@ type components$1 = {
4777
5337
  * @description Target device; must belong to the session owner.
4778
5338
  */
4779
5339
  readonly device_id: string;
4780
- readonly text: string;
5340
+ /**
5341
+ * @description `send` runs `text` as a new turn on the target; `open` only opens the session there (handoff — `text`/`turn_id` ignored, no user turn).
5342
+ * @default send
5343
+ * @enum {string}
5344
+ */
5345
+ readonly mode?: 'send' | 'open';
5346
+ /** @description Prompt for the target. Required unless `mode` is `open` (`400` otherwise). */
5347
+ readonly text?: string;
5348
+ /** @description Ignored when `mode` is `open`. */
4781
5349
  readonly turn_id?: string;
4782
5350
  };
4783
5351
  readonly SessionDispatchResponse: {
4784
5352
  /** @example dispatch:8c2e5f1a-7b3d-4c9e-a0f1-2d3e4f5a6b7c */
4785
5353
  readonly control_id: string;
4786
5354
  readonly duplicate: boolean;
5355
+ /**
5356
+ * @description The effective dispatch mode (`send` when the request omitted it).
5357
+ * @enum {string}
5358
+ */
5359
+ readonly mode: 'send' | 'open';
4787
5360
  /**
4788
5361
  * @description Why no push was delivered — `no_push_token`, `no_token`, `auth_failed`, `network_error`, `unregistered` (token cleared) or `http_<status>`. Absent on success.
4789
5362
  * @example no_push_token
@@ -4941,6 +5514,64 @@ type components$1 = {
4941
5514
  * @enum {string}
4942
5515
  */
4943
5516
  readonly SessionRole: 'viewer' | 'editor' | 'owner';
5517
+ /**
5518
+ * Streaming speech event
5519
+ * @description The `data` of one SSE frame; the SSE `event` name equals `type`.
5520
+ */
5521
+ readonly SpeechStreamEvent: {
5522
+ /** @description `done`: total audio duration reported by Azure. */
5523
+ readonly audio_ms?: number | null;
5524
+ /** @description `audio`: base64 audio chunk in the negotiated format. */
5525
+ readonly delta?: string;
5526
+ /** @description `word`: spoken duration in milliseconds. */
5527
+ readonly durationMs?: number;
5528
+ /** @description `start`: `pcm` or `mp3`. */
5529
+ readonly format?: string;
5530
+ /** @description `viseme`: Azure viseme id. */
5531
+ readonly id?: number;
5532
+ /** @description `viseme` / `word`: position on the audio timeline in milliseconds. */
5533
+ readonly offsetMs?: number;
5534
+ /** @description `start`: audio sample rate in Hz. */
5535
+ readonly sample_rate?: number;
5536
+ /** @description `word`: the word (or punctuation) being spoken. */
5537
+ readonly text?: string;
5538
+ /** @enum {string} */
5539
+ readonly type: 'start' | 'audio' | 'viseme' | 'word' | 'done' | 'error';
5540
+ /** @description `start`: resolved Azure voice name. */
5541
+ readonly voice?: string;
5542
+ };
5543
+ /** Streaming speech request */
5544
+ readonly SpeechStreamRequest: {
5545
+ /**
5546
+ * @description Text to speak. It is XML-escaped into SSML, so markup is read literally.
5547
+ * @example Bună seara! Mulțumesc pentru trandafir!
5548
+ */
5549
+ readonly input: string;
5550
+ /**
5551
+ * @description Azure AI Speech neural TTS.
5552
+ * @default codai-tts-ro
5553
+ * @enum {string}
5554
+ */
5555
+ readonly model?: 'codai-tts-ro' | 'azure-speech';
5556
+ /**
5557
+ * @description `pcm` = raw PCM16 mono 24 kHz (lowest latency); `mp3` = 24 kHz 48 kbit/s.
5558
+ * @default pcm
5559
+ * @enum {string}
5560
+ */
5561
+ readonly response_format?: 'pcm' | 'mp3';
5562
+ /**
5563
+ * @description Speaking rate multiplier (SSML prosody rate).
5564
+ * @default 1
5565
+ */
5566
+ readonly speed?: number;
5567
+ /**
5568
+ * @description `alina` (ro-RO-AlinaNeural), `emil` (ro-RO-EmilNeural) or any Azure neural voice name such as `en-US-AvaNeural`.
5569
+ * @default alina
5570
+ * @example alina
5571
+ * @example ro-RO-EmilNeural
5572
+ */
5573
+ readonly voice?: string;
5574
+ };
4944
5575
  readonly SystemOneAnswer: {
4945
5576
  readonly choice?: string;
4946
5577
  readonly confidence?: number;
@@ -4964,7 +5595,22 @@ type components$1 = {
4964
5595
  /** @enum {string} */
4965
5596
  readonly type: 'choice' | 'score' | 'noul';
4966
5597
  };
5598
+ /** @description Send exactly one of `state` (single) or `items` (batch). */
4967
5599
  readonly SystemOneRequest: {
5600
+ /**
5601
+ * @description `codai-fast` lets the gateway answer with codai-fast (structured output) when codai-s1 is unavailable; the response then has `fallback_used: true`.
5602
+ * @default none
5603
+ * @enum {string}
5604
+ */
5605
+ readonly fallback?: 'none' | 'codai-fast';
5606
+ /** @description Batch mode — the same questions asked about each item's state, concurrently. Ids must be unique. */
5607
+ readonly items?: readonly {
5608
+ readonly id: string;
5609
+ /** @description Text, JSON object or array for this item (≤ 64 000 chars serialised). */
5610
+ readonly state: string | {
5611
+ readonly [key: string]: unknown;
5612
+ } | readonly unknown[];
5613
+ }[];
4968
5614
  /** @description Accepted for symmetry; only codai-s1 is served. */
4969
5615
  readonly model?: string;
4970
5616
  /** @description 1-32 questions keyed by an id you choose; answers come back under the same ids. */
@@ -4972,15 +5618,28 @@ type components$1 = {
4972
5618
  readonly [key: string]: components$1['schemas']['SystemOneQuestion'];
4973
5619
  };
4974
5620
  /** @description Text, JSON object or array the questions are about (≤ 64 000 chars serialised). */
4975
- readonly state: string | {
5621
+ readonly state?: string | {
4976
5622
  readonly [key: string]: unknown;
4977
5623
  } | readonly unknown[];
5624
+ /** @description codai-s1 budget for this call in milliseconds (default set by the gateway, 1500). */
5625
+ readonly timeout_ms?: number;
4978
5626
  };
5627
+ /** @description `answers` for a single `state`, `items` for a batch. */
4979
5628
  readonly SystemOneResponse: {
4980
- readonly answers: {
5629
+ readonly answers?: {
4981
5630
  readonly [key: string]: components$1['schemas']['SystemOneAnswer'];
4982
5631
  };
5632
+ /** @description Present and `true` only when codai-s1 was unavailable and the opt-in codai-fast fallback answered. */
5633
+ readonly fallback_used?: boolean;
5634
+ /** @description Batch results in request order. */
5635
+ readonly items?: readonly {
5636
+ readonly answers: {
5637
+ readonly [key: string]: components$1['schemas']['SystemOneAnswer'];
5638
+ };
5639
+ readonly id: string;
5640
+ }[];
4983
5641
  readonly latency_ms: number;
5642
+ /** @description `codai-s1`, or `codai-fast` when the opt-in fallback answered. */
4984
5643
  readonly model: string;
4985
5644
  readonly usage: {
4986
5645
  readonly input_tokens?: number;
@@ -6010,6 +6669,69 @@ interface operations$1 {
6010
6669
  };
6011
6670
  };
6012
6671
  };
6672
+ readonly createSpeechStream: {
6673
+ readonly parameters: {
6674
+ readonly query?: never;
6675
+ readonly header?: {
6676
+ /** @description Groups requests of one conversation for receipts, stickiness and prompt caching. */
6677
+ readonly 'x-codai-session-id'?: components$1['parameters']['SessionIdHeader'];
6678
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
6679
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
6680
+ };
6681
+ readonly path?: never;
6682
+ readonly cookie?: never;
6683
+ };
6684
+ readonly requestBody: {
6685
+ readonly content: {
6686
+ readonly 'application/json': components$1['schemas']['SpeechStreamRequest'];
6687
+ };
6688
+ };
6689
+ readonly responses: {
6690
+ /** @description SSE stream: `start`, then `audio` / `viseme` / `word` events, then `done` (or `error`). */
6691
+ readonly 200: {
6692
+ headers: {
6693
+ /** @description Media type and sample rate of the `audio` deltas, e.g. `audio/pcm;rate=24000`. */
6694
+ readonly 'x-codai-audio-format'?: string;
6695
+ /** @description `azure-speech:<voice>`. */
6696
+ readonly 'x-codai-routed-to'?: string;
6697
+ readonly [name: string]: unknown;
6698
+ };
6699
+ content: {
6700
+ readonly 'text/event-stream': components$1['schemas']['SpeechStreamEvent'];
6701
+ };
6702
+ };
6703
+ /** @description Invalid body, unknown `model`, or `voice` is not an Azure neural voice name. */
6704
+ readonly 400: {
6705
+ headers: {
6706
+ readonly [name: string]: unknown;
6707
+ };
6708
+ content: {
6709
+ readonly 'application/json': components$1['schemas']['Error'];
6710
+ };
6711
+ };
6712
+ readonly 401: components$1['responses']['Unauthorized'];
6713
+ readonly 402: components$1['responses']['PaymentRequired'];
6714
+ /** @description The credential is an ephemeral token minted for another scope, or an EU data-residency account while the Speech region is outside the EU. */
6715
+ readonly 403: {
6716
+ headers: {
6717
+ readonly [name: string]: unknown;
6718
+ };
6719
+ content: {
6720
+ readonly 'application/json': components$1['schemas']['Error'];
6721
+ };
6722
+ };
6723
+ readonly 429: components$1['responses']['RateLimited'];
6724
+ /** @description Azure Speech is not configured on this gateway (`code: tts_unavailable`). */
6725
+ readonly 503: {
6726
+ headers: {
6727
+ readonly [name: string]: unknown;
6728
+ };
6729
+ content: {
6730
+ readonly 'application/json': components$1['schemas']['Error'];
6731
+ };
6732
+ };
6733
+ };
6734
+ };
6013
6735
  readonly createTranscription: {
6014
6736
  readonly parameters: {
6015
6737
  readonly query?: never;
@@ -7720,6 +8442,155 @@ interface operations$1 {
7720
8442
  readonly 403: components$1['responses']['Forbidden'];
7721
8443
  };
7722
8444
  };
8445
+ readonly editImage: {
8446
+ readonly parameters: {
8447
+ readonly query?: never;
8448
+ readonly header?: {
8449
+ /** @description Groups requests of one conversation for receipts, stickiness and prompt caching. */
8450
+ readonly 'x-codai-session-id'?: components$1['parameters']['SessionIdHeader'];
8451
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
8452
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
8453
+ };
8454
+ readonly path?: never;
8455
+ readonly cookie?: never;
8456
+ };
8457
+ readonly requestBody: {
8458
+ readonly content: {
8459
+ readonly 'application/json': components$1['schemas']['CoreImageEditRequest'];
8460
+ readonly 'multipart/form-data': components$1['schemas']['CoreImageEditForm'];
8461
+ };
8462
+ };
8463
+ readonly responses: {
8464
+ /** @description Edited images, base64-encoded, in OpenAI shape. */
8465
+ readonly 200: {
8466
+ headers: {
8467
+ /** @description Charge for this request in micro-USD, from the model's reported token usage (images returned only). */
8468
+ readonly 'x-codai-cost-micro-usd'?: number;
8469
+ /** @description Vertex location that processed the request — `eu` (EU multi-region) or `global`. */
8470
+ readonly 'x-codai-data-region'?: 'eu' | 'global';
8471
+ /** @description Adapter kind that served the request. */
8472
+ readonly 'x-codai-provider'?: 'vertex-gemini-image';
8473
+ /** @description Upstream model that produced the images. */
8474
+ readonly 'x-codai-routed-to'?: string;
8475
+ readonly [name: string]: unknown;
8476
+ };
8477
+ content: {
8478
+ readonly 'application/json': components$1['schemas']['CoreImagesResponse'];
8479
+ };
8480
+ };
8481
+ /** @description Body is not valid JSON or multipart, fails validation, has no input image or more than the model accepts, sends `mask`, asks for `response_format` other than `b64_json`, names an unknown model or an unsupported `image_size`, or every image was blocked by the safety filter (code `content_filtered`, not charged). */
8482
+ readonly 400: {
8483
+ headers: {
8484
+ readonly [name: string]: unknown;
8485
+ };
8486
+ content: {
8487
+ readonly 'application/json': components$1['schemas']['Error'];
8488
+ };
8489
+ };
8490
+ readonly 401: components$1['responses']['Unauthorized'];
8491
+ readonly 403: components$1['responses']['Forbidden'];
8492
+ /** @description Rate limit exceeded, or the daily or monthly spend cap has been reached. */
8493
+ readonly 429: {
8494
+ headers: {
8495
+ readonly [name: string]: unknown;
8496
+ };
8497
+ content: {
8498
+ readonly 'application/json': components$1['schemas']['Error'];
8499
+ };
8500
+ };
8501
+ readonly 502: components$1['responses']['UpstreamError'];
8502
+ };
8503
+ };
8504
+ readonly createImage: {
8505
+ readonly parameters: {
8506
+ readonly query?: never;
8507
+ readonly header?: {
8508
+ /** @description Groups requests of one conversation for receipts, stickiness and prompt caching. */
8509
+ readonly 'x-codai-session-id'?: components$1['parameters']['SessionIdHeader'];
8510
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
8511
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
8512
+ };
8513
+ readonly path?: never;
8514
+ readonly cookie?: never;
8515
+ };
8516
+ readonly requestBody: {
8517
+ readonly content: {
8518
+ readonly 'application/json': components$1['schemas']['CoreImagesRequest'];
8519
+ };
8520
+ };
8521
+ readonly responses: {
8522
+ /** @description Generated images, base64-encoded, in OpenAI shape. */
8523
+ readonly 200: {
8524
+ headers: {
8525
+ /** @description Charge for this request in micro-USD, from the model's reported token usage (images returned only). */
8526
+ readonly 'x-codai-cost-micro-usd'?: number;
8527
+ /** @description Vertex location that processed the request — `eu` (EU multi-region) or `global`. */
8528
+ readonly 'x-codai-data-region'?: 'eu' | 'global';
8529
+ /** @description Adapter kind that served the request. */
8530
+ readonly 'x-codai-provider'?: 'vertex-gemini-image';
8531
+ /** @description Upstream model that produced the images. */
8532
+ readonly 'x-codai-routed-to'?: string;
8533
+ readonly [name: string]: unknown;
8534
+ };
8535
+ content: {
8536
+ readonly 'application/json': components$1['schemas']['CoreImagesResponse'];
8537
+ };
8538
+ };
8539
+ /** @description Body is not valid JSON, fails validation, asks for `response_format` other than `b64_json`, names an unknown model, asks for an `image_size` the model does not support, sends more reference images than the model accepts, or every image was blocked by the safety filter (code `content_filtered`, not charged). */
8540
+ readonly 400: {
8541
+ headers: {
8542
+ readonly [name: string]: unknown;
8543
+ };
8544
+ content: {
8545
+ readonly 'application/json': components$1['schemas']['Error'];
8546
+ };
8547
+ };
8548
+ readonly 401: components$1['responses']['Unauthorized'];
8549
+ readonly 403: components$1['responses']['Forbidden'];
8550
+ /** @description Rate limit exceeded, or the daily or monthly spend cap has been reached. */
8551
+ readonly 429: {
8552
+ headers: {
8553
+ readonly [name: string]: unknown;
8554
+ };
8555
+ content: {
8556
+ readonly 'application/json': components$1['schemas']['Error'];
8557
+ };
8558
+ };
8559
+ readonly 502: components$1['responses']['UpstreamError'];
8560
+ };
8561
+ };
8562
+ readonly revokeSelfKey: {
8563
+ readonly parameters: {
8564
+ readonly query?: never;
8565
+ readonly header?: {
8566
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
8567
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
8568
+ };
8569
+ readonly path?: never;
8570
+ readonly cookie?: never;
8571
+ };
8572
+ readonly requestBody?: never;
8573
+ readonly responses: {
8574
+ /** @description Revoked. */
8575
+ readonly 200: {
8576
+ headers: {
8577
+ readonly [name: string]: unknown;
8578
+ };
8579
+ content: {
8580
+ readonly 'application/json': {
8581
+ /**
8582
+ * Format: uuid
8583
+ * @description Id of the revoked key.
8584
+ */
8585
+ readonly id: string;
8586
+ readonly revoked: boolean;
8587
+ };
8588
+ };
8589
+ };
8590
+ readonly 400: components$1['responses']['BadRequest'];
8591
+ readonly 401: components$1['responses']['Unauthorized'];
8592
+ };
8593
+ };
7723
8594
  readonly createMessage: {
7724
8595
  readonly parameters: {
7725
8596
  readonly query?: never;
@@ -8380,12 +9251,214 @@ interface operations$1 {
8380
9251
  readonly [name: string]: unknown;
8381
9252
  };
8382
9253
  content: {
8383
- readonly 'application/json': components$1['schemas']['Error'];
9254
+ readonly 'application/json': components$1['schemas']['Error'];
9255
+ };
9256
+ };
9257
+ };
9258
+ };
9259
+ readonly updateProject: {
9260
+ readonly parameters: {
9261
+ readonly query?: never;
9262
+ readonly header?: {
9263
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
9264
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
9265
+ };
9266
+ readonly path: {
9267
+ /** @description Project UUID. A malformed value is 400; an unknown or foreign project is 404. */
9268
+ readonly id: components$1['parameters']['ProjectId'];
9269
+ };
9270
+ readonly cookie?: never;
9271
+ };
9272
+ readonly requestBody: {
9273
+ readonly content: {
9274
+ readonly 'application/json': components$1['schemas']['ProjectPatchBody'];
9275
+ };
9276
+ };
9277
+ readonly responses: {
9278
+ /** @description The updated project. */
9279
+ readonly 200: {
9280
+ headers: {
9281
+ readonly [name: string]: unknown;
9282
+ };
9283
+ content: {
9284
+ readonly 'application/json': {
9285
+ readonly project: components$1['schemas']['Project'];
9286
+ };
9287
+ };
9288
+ };
9289
+ readonly 400: components$1['responses']['BadRequest'];
9290
+ readonly 401: components$1['responses']['Unauthorized'];
9291
+ readonly 402: components$1['responses']['PaymentRequired'];
9292
+ readonly 403: components$1['responses']['Forbidden'];
9293
+ readonly 404: components$1['responses']['NotFound'];
9294
+ };
9295
+ };
9296
+ readonly listPrompts: {
9297
+ readonly parameters: {
9298
+ readonly query?: {
9299
+ /** @description Maximum rows (1–200). */
9300
+ readonly limit?: number;
9301
+ /** @description Filter: a prompt status, `due` or `all`. */
9302
+ readonly status?: 'open' | 'due' | 'all' | 'launched' | 'done' | 'dismissed' | 'superseded';
9303
+ };
9304
+ readonly header?: {
9305
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
9306
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
9307
+ };
9308
+ readonly path?: never;
9309
+ readonly cookie?: never;
9310
+ };
9311
+ readonly requestBody?: never;
9312
+ readonly responses: {
9313
+ /** @description Matching prompts. */
9314
+ readonly 200: {
9315
+ headers: {
9316
+ readonly [name: string]: unknown;
9317
+ };
9318
+ content: {
9319
+ readonly 'application/json': {
9320
+ readonly data: readonly components$1['schemas']['Prompt'][];
9321
+ };
9322
+ };
9323
+ };
9324
+ readonly 400: components$1['responses']['BadRequest'];
9325
+ readonly 401: components$1['responses']['Unauthorized'];
9326
+ readonly 402: components$1['responses']['PaymentRequired'];
9327
+ };
9328
+ };
9329
+ readonly createPrompt: {
9330
+ readonly parameters: {
9331
+ readonly query?: never;
9332
+ readonly header?: {
9333
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
9334
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
9335
+ };
9336
+ readonly path?: never;
9337
+ readonly cookie?: never;
9338
+ };
9339
+ readonly requestBody: {
9340
+ readonly content: {
9341
+ readonly 'application/json': components$1['schemas']['PromptCreate'];
9342
+ };
9343
+ };
9344
+ readonly responses: {
9345
+ /** @description The same text already existed; nothing was created. */
9346
+ readonly 200: {
9347
+ headers: {
9348
+ readonly [name: string]: unknown;
9349
+ };
9350
+ content: {
9351
+ readonly 'application/json': components$1['schemas']['PromptCreated'];
9352
+ };
9353
+ };
9354
+ /** @description Prompt created. */
9355
+ readonly 201: {
9356
+ headers: {
9357
+ readonly [name: string]: unknown;
9358
+ };
9359
+ content: {
9360
+ readonly 'application/json': components$1['schemas']['PromptCreated'];
9361
+ };
9362
+ };
9363
+ readonly 400: components$1['responses']['BadRequest'];
9364
+ readonly 401: components$1['responses']['Unauthorized'];
9365
+ readonly 402: components$1['responses']['PaymentRequired'];
9366
+ };
9367
+ };
9368
+ readonly getPrompt: {
9369
+ readonly parameters: {
9370
+ readonly query?: never;
9371
+ readonly header?: {
9372
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
9373
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
9374
+ };
9375
+ readonly path: {
9376
+ /** @description Pending prompt id (uuid). A foreign or malformed id is 404. */
9377
+ readonly id: string;
9378
+ };
9379
+ readonly cookie?: never;
9380
+ };
9381
+ readonly requestBody?: never;
9382
+ readonly responses: {
9383
+ /** @description The prompt. */
9384
+ readonly 200: {
9385
+ headers: {
9386
+ readonly [name: string]: unknown;
9387
+ };
9388
+ content: {
9389
+ readonly 'application/json': components$1['schemas']['Prompt'];
9390
+ };
9391
+ };
9392
+ readonly 401: components$1['responses']['Unauthorized'];
9393
+ readonly 402: components$1['responses']['PaymentRequired'];
9394
+ readonly 404: components$1['responses']['NotFound'];
9395
+ };
9396
+ };
9397
+ readonly deletePrompt: {
9398
+ readonly parameters: {
9399
+ readonly query?: never;
9400
+ readonly header?: {
9401
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
9402
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
9403
+ };
9404
+ readonly path: {
9405
+ /** @description Pending prompt id (uuid). A foreign or malformed id is 404. */
9406
+ readonly id: string;
9407
+ };
9408
+ readonly cookie?: never;
9409
+ };
9410
+ readonly requestBody?: never;
9411
+ readonly responses: {
9412
+ /** @description How many prompts were deleted (0 or 1). */
9413
+ readonly 200: {
9414
+ headers: {
9415
+ readonly [name: string]: unknown;
9416
+ };
9417
+ content: {
9418
+ readonly 'application/json': {
9419
+ readonly deleted: number;
9420
+ };
9421
+ };
9422
+ };
9423
+ readonly 401: components$1['responses']['Unauthorized'];
9424
+ readonly 402: components$1['responses']['PaymentRequired'];
9425
+ };
9426
+ };
9427
+ readonly updatePrompt: {
9428
+ readonly parameters: {
9429
+ readonly query?: never;
9430
+ readonly header?: {
9431
+ /** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
9432
+ readonly 'x-request-id'?: components$1['parameters']['RequestId'];
9433
+ };
9434
+ readonly path: {
9435
+ /** @description Pending prompt id (uuid). A foreign or malformed id is 404. */
9436
+ readonly id: string;
9437
+ };
9438
+ readonly cookie?: never;
9439
+ };
9440
+ readonly requestBody: {
9441
+ readonly content: {
9442
+ readonly 'application/json': components$1['schemas']['PromptPatch'];
9443
+ };
9444
+ };
9445
+ readonly responses: {
9446
+ /** @description The updated prompt. */
9447
+ readonly 200: {
9448
+ headers: {
9449
+ readonly [name: string]: unknown;
9450
+ };
9451
+ content: {
9452
+ readonly 'application/json': components$1['schemas']['Prompt'];
8384
9453
  };
8385
9454
  };
9455
+ readonly 400: components$1['responses']['BadRequest'];
9456
+ readonly 401: components$1['responses']['Unauthorized'];
9457
+ readonly 402: components$1['responses']['PaymentRequired'];
9458
+ readonly 404: components$1['responses']['NotFound'];
8386
9459
  };
8387
9460
  };
8388
- readonly updateProject: {
9461
+ readonly launchPrompt: {
8389
9462
  readonly parameters: {
8390
9463
  readonly query?: never;
8391
9464
  readonly header?: {
@@ -8393,32 +9466,42 @@ interface operations$1 {
8393
9466
  readonly 'x-request-id'?: components$1['parameters']['RequestId'];
8394
9467
  };
8395
9468
  readonly path: {
8396
- /** @description Project UUID. A malformed value is 400; an unknown or foreign project is 404. */
8397
- readonly id: components$1['parameters']['ProjectId'];
9469
+ /** @description Pending prompt id (uuid). A foreign or malformed id is 404. */
9470
+ readonly id: string;
8398
9471
  };
8399
9472
  readonly cookie?: never;
8400
9473
  };
8401
- readonly requestBody: {
9474
+ readonly requestBody?: {
8402
9475
  readonly content: {
8403
- readonly 'application/json': components$1['schemas']['ProjectPatchBody'];
9476
+ readonly 'application/json': {
9477
+ /**
9478
+ * Format: uuid
9479
+ * @description One of your devices; overrides the prompt target.
9480
+ */
9481
+ readonly device_id?: string;
9482
+ };
8404
9483
  };
8405
9484
  };
8406
9485
  readonly responses: {
8407
- /** @description The updated project. */
9486
+ /** @description The session that was started. */
8408
9487
  readonly 200: {
8409
9488
  headers: {
8410
9489
  readonly [name: string]: unknown;
8411
9490
  };
8412
9491
  content: {
8413
9492
  readonly 'application/json': {
8414
- readonly project: components$1['schemas']['Project'];
9493
+ /** Format: uuid */
9494
+ readonly device_id: string;
9495
+ /** @description Whether a push dispatch reached the device. */
9496
+ readonly pushed: boolean;
9497
+ /** Format: uuid */
9498
+ readonly session_id: string;
8415
9499
  };
8416
9500
  };
8417
9501
  };
8418
9502
  readonly 400: components$1['responses']['BadRequest'];
8419
9503
  readonly 401: components$1['responses']['Unauthorized'];
8420
9504
  readonly 402: components$1['responses']['PaymentRequired'];
8421
- readonly 403: components$1['responses']['Forbidden'];
8422
9505
  readonly 404: components$1['responses']['NotFound'];
8423
9506
  };
8424
9507
  };
@@ -9352,7 +10435,7 @@ interface operations$1 {
9352
10435
  };
9353
10436
  };
9354
10437
  readonly responses: {
9355
- /** @description One typed answer per question id. */
10438
+ /** @description One typed answer per question id (`answers`), or per item and question id (`items`) for a batch. */
9356
10439
  readonly 200: {
9357
10440
  headers: {
9358
10441
  readonly [name: string]: unknown;
@@ -9361,7 +10444,7 @@ interface operations$1 {
9361
10444
  readonly 'application/json': components$1['schemas']['SystemOneResponse'];
9362
10445
  };
9363
10446
  };
9364
- /** @description Body is not valid JSON, a question is malformed (option/level counts), or `state` is too large. */
10447
+ /** @description Body is not valid JSON, a question is malformed (option/level counts), a `state` is too large, both or neither of `state`/`items` were sent, more than 16 items, duplicate item ids, or `timeout_ms` outside 100-5000. */
9365
10448
  readonly 400: {
9366
10449
  headers: {
9367
10450
  readonly [name: string]: unknown;
@@ -9373,7 +10456,7 @@ interface operations$1 {
9373
10456
  readonly 401: components$1['responses']['Unauthorized'];
9374
10457
  readonly 413: components$1['responses']['PayloadTooLarge'];
9375
10458
  readonly 429: components$1['responses']['RateLimited'];
9376
- /** @description codai-s1 is disabled, unreachable or exceeded its budget (`code: s1_unavailable`). Use your local fallback. */
10459
+ /** @description codai-s1 is disabled, unreachable or exceeded its budget (`code: s1_unavailable`), and no opt-in fallback answered. Use your local fallback. */
9377
10460
  readonly 503: {
9378
10461
  headers: {
9379
10462
  readonly [name: string]: unknown;
@@ -9983,6 +11066,62 @@ interface operations$1 {
9983
11066
  readonly 404: components$1['responses']['NotFound'];
9984
11067
  };
9985
11068
  };
11069
+ readonly verifyAgentOutput: {
11070
+ readonly parameters: {
11071
+ readonly query?: never;
11072
+ readonly header?: never;
11073
+ readonly path?: never;
11074
+ readonly cookie?: never;
11075
+ };
11076
+ /** @description The signed payload and the signature. */
11077
+ readonly requestBody: {
11078
+ readonly content: {
11079
+ readonly 'application/json': components$1['schemas']['AgentOutputVerifyRequest'];
11080
+ };
11081
+ };
11082
+ readonly responses: {
11083
+ /** @description Verification result. */
11084
+ readonly 200: {
11085
+ headers: {
11086
+ readonly [name: string]: unknown;
11087
+ };
11088
+ content: {
11089
+ readonly 'application/json': components$1['schemas']['AgentOutputVerifyResult'];
11090
+ };
11091
+ };
11092
+ readonly 400: components$1['responses']['BadRequest'];
11093
+ readonly 413: components$1['responses']['PayloadTooLarge'];
11094
+ /** @description Output signing is not enabled on this deployment (`code: signing_disabled`). */
11095
+ readonly 503: {
11096
+ headers: {
11097
+ readonly [name: string]: unknown;
11098
+ };
11099
+ content: {
11100
+ readonly 'application/json': components$1['schemas']['Error'];
11101
+ };
11102
+ };
11103
+ };
11104
+ };
11105
+ readonly getAgentOutputKey: {
11106
+ readonly parameters: {
11107
+ readonly query?: never;
11108
+ readonly header?: never;
11109
+ readonly path?: never;
11110
+ readonly cookie?: never;
11111
+ };
11112
+ readonly requestBody?: never;
11113
+ readonly responses: {
11114
+ /** @description The signing key, or `enabled: false`. */
11115
+ readonly 200: {
11116
+ headers: {
11117
+ readonly [name: string]: unknown;
11118
+ };
11119
+ content: {
11120
+ readonly 'application/json': components$1['schemas']['AgentOutputKey'];
11121
+ };
11122
+ };
11123
+ };
11124
+ };
9986
11125
  readonly getRelayEnvironmentStatus: {
9987
11126
  readonly parameters: {
9988
11127
  readonly query?: never;
@@ -10117,7 +11256,7 @@ interface CodaiRequestExtensions {
10117
11256
  /** `x-codai-device-name` */
10118
11257
  deviceName?: string;
10119
11258
  /** `x-codai-device-platform` */
10120
- devicePlatform?: 'android' | 'ios' | 'web' | 'desktop' | 'cli' | 'agent';
11259
+ devicePlatform?: 'android' | 'ios' | 'web' | 'desktop' | 'cli' | 'agent' | 'wear' | 'vscode';
10121
11260
  /** `x-codai-push-token` */
10122
11261
  pushToken?: string;
10123
11262
  /** `x-codai-share-token` */
@@ -10228,7 +11367,7 @@ type Receipt = Reply<'getReceipt'>;
10228
11367
  type FeedbackRequest = Mutable<Body<'submitFeedback'>>;
10229
11368
  type FeedbackResponse = Reply<'submitFeedback'>;
10230
11369
  type PhoneModel = Schema<'AccountPhoneModel'>;
10231
- type CallOpts$b = {
11370
+ type CallOpts$d = {
10232
11371
  ext?: CodaiRequestExtensions;
10233
11372
  signal?: AbortSignal;
10234
11373
  };
@@ -10236,9 +11375,9 @@ declare class Account {
10236
11375
  private readonly http;
10237
11376
  constructor(http: HttpClient);
10238
11377
  /** `GET /v1/account` — the full account card. */
10239
- get(opts?: CallOpts$b): Promise<AccountView>;
11378
+ get(opts?: CallOpts$d): Promise<AccountView>;
10240
11379
  /** `PATCH /v1/account` — consents, username, referral (at least one field). */
10241
- update(body: AccountPatchRequest, opts?: CallOpts$b): Promise<AccountPatchResponse>;
11380
+ update(body: AccountPatchRequest, opts?: CallOpts$d): Promise<AccountPatchResponse>;
10242
11381
  }
10243
11382
  declare class Receipts {
10244
11383
  private readonly http;
@@ -10250,7 +11389,7 @@ declare class Receipts {
10250
11389
  get(query?: {
10251
11390
  sessionId?: string;
10252
11391
  since?: string | Date;
10253
- }, opts?: CallOpts$b): Promise<Receipt>;
11392
+ }, opts?: CallOpts$d): Promise<Receipt>;
10254
11393
  }
10255
11394
  declare class Feedback {
10256
11395
  private readonly http;
@@ -10259,13 +11398,13 @@ declare class Feedback {
10259
11398
  * `POST /v1/feedback` — rate one turn. Exactly one of `event_id`,
10260
11399
  * `session_id`, `client_request_id` must be present.
10261
11400
  */
10262
- submit(body: FeedbackRequest, opts?: CallOpts$b): Promise<FeedbackResponse>;
11401
+ submit(body: FeedbackRequest, opts?: CallOpts$d): Promise<FeedbackResponse>;
10263
11402
  }
10264
11403
  declare class PhoneModels {
10265
11404
  private readonly http;
10266
11405
  constructor(http: HttpClient);
10267
11406
  /** `GET /v1/phone/models` — on-device model catalog with signed URLs. */
10268
- list(opts?: CallOpts$b): Promise<PhoneModel[]>;
11407
+ list(opts?: CallOpts$d): Promise<PhoneModel[]>;
10269
11408
  }
10270
11409
 
10271
11410
  /** `/v1/agents/*` — synchronous runs and the persisted async run lifecycle. */
@@ -10278,7 +11417,7 @@ type AgentRun = Reply<'getAgentRun'>;
10278
11417
  type AgentRunStep = Schema<'AgentRunStep'>;
10279
11418
  type AgentRunStats = Reply<'getAgentRunStats'>;
10280
11419
  type AgentRunStatus = Schema<'AgentRunStatus'>;
10281
- type CallOpts$a = {
11420
+ type CallOpts$c = {
10282
11421
  ext?: CodaiRequestExtensions;
10283
11422
  signal?: AbortSignal;
10284
11423
  };
@@ -10315,34 +11454,75 @@ declare class AgentRuns {
10315
11454
  private readonly http;
10316
11455
  constructor(http: HttpClient);
10317
11456
  /** `POST /v1/agents/runs` — returns 202 with the run id. */
10318
- create(body: AgentRunCreateRequest, opts?: CallOpts$a): Promise<AgentRunAccepted>;
11457
+ create(body: AgentRunCreateRequest, opts?: CallOpts$c): Promise<AgentRunAccepted>;
10319
11458
  /** `GET /v1/agents/runs/{id}` */
10320
- get(id: string, opts?: CallOpts$a): Promise<AgentRun>;
11459
+ get(id: string, opts?: CallOpts$c): Promise<AgentRun>;
10321
11460
  /** `GET /v1/agents/runs/{id}/steps` — newest first. */
10322
- steps(id: string, opts?: CallOpts$a): Promise<AgentRunStep[]>;
11461
+ steps(id: string, opts?: CallOpts$c): Promise<AgentRunStep[]>;
10323
11462
  /** `GET /v1/agents/runs/stats?days=` */
10324
- stats(days?: number, opts?: CallOpts$a): Promise<AgentRunStats>;
11463
+ stats(days?: number, opts?: CallOpts$c): Promise<AgentRunStats>;
10325
11464
  /** `POST /v1/agents/runs/{id}/cancel` */
10326
- cancel(id: string, opts?: CallOpts$a): Promise<Reply<'cancelAgentRun'>>;
11465
+ cancel(id: string, opts?: CallOpts$c): Promise<Reply<'cancelAgentRun'>>;
10327
11466
  /**
10328
11467
  * `GET /v1/agents/runs/{id}/stream` — async iterator over `step` / `done` /
10329
11468
  * `timeout` events. The iterator ends after `done`; on `timeout` (30 min)
10330
11469
  * it also ends and you may reconnect (full replay from seq 0).
10331
11470
  */
10332
- stream(id: string, opts?: CallOpts$a): AsyncGenerator<AgentRunStreamEvent, void, undefined>;
11471
+ stream(id: string, opts?: CallOpts$c): AsyncGenerator<AgentRunStreamEvent, void, undefined>;
10333
11472
  }
10334
11473
  declare class Agents {
10335
11474
  private readonly http;
10336
11475
  readonly runs: AgentRuns;
10337
11476
  constructor(http: HttpClient);
10338
11477
  /** `POST /v1/agents/run` — blocks until the agent loop finishes. */
10339
- run(body: AgentRunRequest, opts?: CallOpts$a): Promise<AgentRunResult>;
11478
+ run(body: AgentRunRequest, opts?: CallOpts$c): Promise<AgentRunResult>;
10340
11479
  }
10341
11480
 
10342
- /** `POST /v1/audio/transcriptions` and `POST /v1/audio/speech`. */
11481
+ /** `POST /v1/audio/transcriptions`, `POST /v1/audio/speech` and `POST /v1/audio/speech/stream`. */
10343
11482
 
10344
11483
  type TranscriptionResponse = Reply<'createTranscription'>;
10345
11484
  type SpeechRequest = Mutable<Body<'createSpeech'>>;
11485
+ type SpeechStreamRequest = Mutable<Body<'createSpeechStream'>>;
11486
+ /** One event of `audio.speechStream()` (Azure neural TTS with lip-sync timing). */
11487
+ type SpeechStreamEvent = {
11488
+ type: 'start';
11489
+ model: string;
11490
+ voice: string;
11491
+ format: 'pcm' | 'mp3';
11492
+ content_type: string;
11493
+ sample_rate: number;
11494
+ }
11495
+ /** `delta` is base64; `audio` is the decoded bytes (PCM16 LE mono 24 kHz for `pcm`). */
11496
+ | {
11497
+ type: 'audio';
11498
+ delta: string;
11499
+ audio: Uint8Array;
11500
+ }
11501
+ /** Azure viseme id (0-21) at `offsetMs` on the audio timeline. */
11502
+ | {
11503
+ type: 'viseme';
11504
+ id: number;
11505
+ offsetMs: number;
11506
+ } | {
11507
+ type: 'word';
11508
+ text: string;
11509
+ offsetMs: number;
11510
+ durationMs: number;
11511
+ } | {
11512
+ type: 'done';
11513
+ audio_ms: number | null;
11514
+ audioBytes: number;
11515
+ visemes: number;
11516
+ words: number;
11517
+ } | {
11518
+ type: 'error';
11519
+ error: {
11520
+ code: string;
11521
+ message: string;
11522
+ };
11523
+ };
11524
+ /** Raw generated event schema (all fields optional). */
11525
+ type SpeechStreamEventSchema = Schema<'SpeechStreamEvent'>;
10346
11526
  interface TranscriptionOptions {
10347
11527
  /** Audio file contents (max 25 MB). */
10348
11528
  file: Blob | Uint8Array | ArrayBuffer;
@@ -10396,6 +11576,16 @@ declare class Audio {
10396
11576
  ext?: CodaiRequestExtensions;
10397
11577
  signal?: AbortSignal;
10398
11578
  }): Promise<SpeechResult>;
11579
+ /**
11580
+ * Streaming neural TTS with visemes + word boundaries (`codai-tts-ro`, Azure AI Speech).
11581
+ * Yields `start`, then `audio` / `viseme` / `word` in synthesis order, then `done` (or `error`).
11582
+ * Voices: `alina` (default), `emil`, or any Azure neural voice name. Default format `pcm`
11583
+ * (PCM16 mono 24 kHz). Works with an ephemeral token of scope `audio` or `live`.
11584
+ */
11585
+ speechStream(body: SpeechStreamRequest, opts?: {
11586
+ ext?: CodaiRequestExtensions;
11587
+ signal?: AbortSignal;
11588
+ }): AsyncGenerator<SpeechStreamEvent, void, undefined>;
10399
11589
  }
10400
11590
 
10401
11591
  /** `POST /v1/chat/completions` — OpenAI-compatible completions (JSON + SSE). */
@@ -10513,7 +11703,7 @@ type Device = Schema<'DeviceListItem'>;
10513
11703
  type DevicePatch = Mutable<Body<'updateDevice'>>;
10514
11704
  type DevicePatched = Reply<'updateDevice'>;
10515
11705
  type DispatchInbox = Reply<'getMyDispatchInbox'>;
10516
- type CallOpts$9 = {
11706
+ type CallOpts$b = {
10517
11707
  ext?: CodaiRequestExtensions;
10518
11708
  signal?: AbortSignal;
10519
11709
  };
@@ -10521,18 +11711,23 @@ declare class Devices {
10521
11711
  private readonly http;
10522
11712
  constructor(http: HttpClient);
10523
11713
  /** `GET /v1/devices` — most recently seen first. */
10524
- list(opts?: CallOpts$9): Promise<Device[]>;
11714
+ list(opts?: CallOpts$b): Promise<Device[]>;
10525
11715
  /** `PATCH /v1/devices/{id}` — push token and/or capabilities. */
10526
- update(id: string, body: DevicePatch, opts?: CallOpts$9): Promise<DevicePatched>;
11716
+ update(id: string, body: DevicePatch, opts?: CallOpts$b): Promise<DevicePatched>;
10527
11717
  /** `DELETE /v1/devices/{id}` */
10528
- delete(id: string, opts?: CallOpts$9): Promise<Reply<'deleteDevice'>>;
11718
+ delete(id: string, opts?: CallOpts$b): Promise<Reply<'deleteDevice'>>;
11719
+ /**
11720
+ * `POST /v1/keys/self/revoke` — the API key this client uses revokes ITSELF (sign out).
11721
+ * Every later call with it fails with 401.
11722
+ */
11723
+ revokeSelfKey(opts?: CallOpts$b): Promise<Reply<'revokeSelfKey'>>;
10529
11724
  /**
10530
11725
  * `GET /v1/devices/me/dispatch?limit=` — pending controls dispatched at the
10531
11726
  * calling device (`x-codai-device` required) across all owned sessions.
10532
11727
  */
10533
11728
  dispatchInbox(query?: {
10534
11729
  limit?: number;
10535
- }, opts?: CallOpts$9): Promise<DispatchInbox>;
11730
+ }, opts?: CallOpts$b): Promise<DispatchInbox>;
10536
11731
  }
10537
11732
 
10538
11733
  /** `POST /v1/embeddings`. */
@@ -10588,7 +11783,7 @@ type EnvironmentTaskList = Reply<'listEnvironmentTasks'>;
10588
11783
  type EnvironmentTaskCreateBody = Mutable<Body<'createEnvironmentTask'>>;
10589
11784
  type EnvironmentTaskCreated = Reply<'createEnvironmentTask'>;
10590
11785
  type EnvironmentTaskDetail = Reply<'getEnvironmentTask'>;
10591
- type CallOpts$8 = {
11786
+ type CallOpts$a = {
10592
11787
  ext?: CodaiRequestExtensions;
10593
11788
  signal?: AbortSignal;
10594
11789
  };
@@ -10596,48 +11791,48 @@ declare class EnvironmentMembers {
10596
11791
  private readonly http;
10597
11792
  constructor(http: HttpClient);
10598
11793
  /** `GET /v1/environments/{id}/members` — any role. */
10599
- list(envId: string, opts?: CallOpts$8): Promise<EnvironmentMember[]>;
11794
+ list(envId: string, opts?: CallOpts$a): Promise<EnvironmentMember[]>;
10600
11795
  /** `POST /v1/environments/{id}/members` — exactly one of `user_id` / `email`. */
10601
- add(envId: string, body: EnvironmentAddMemberBody, opts?: CallOpts$8): Promise<EnvironmentMemberCreated>;
11796
+ add(envId: string, body: EnvironmentAddMemberBody, opts?: CallOpts$a): Promise<EnvironmentMemberCreated>;
10602
11797
  /** `PUT /v1/environments/{id}/members/me/ssh-key` — one `authorized_keys` line. */
10603
- setSshKey(envId: string, publicKey: string, opts?: CallOpts$8): Promise<Reply<'setMyEnvironmentSshKey'>>;
11798
+ setSshKey(envId: string, publicKey: string, opts?: CallOpts$a): Promise<Reply<'setMyEnvironmentSshKey'>>;
10604
11799
  /** `PATCH /v1/environments/{id}/members/{userId}` — 409 `last_owner` on demoting the last owner. */
10605
- setRole(envId: string, userId: string, role: EnvironmentRole, opts?: CallOpts$8): Promise<Reply<'setEnvironmentMemberRole'>['member']>;
11800
+ setRole(envId: string, userId: string, role: EnvironmentRole, opts?: CallOpts$a): Promise<Reply<'setEnvironmentMemberRole'>['member']>;
10606
11801
  /** `DELETE /v1/environments/{id}/members/{userId}` — pass your own id to leave. */
10607
- remove(envId: string, userId: string, opts?: CallOpts$8): Promise<Reply<'removeEnvironmentMember'>>;
11802
+ remove(envId: string, userId: string, opts?: CallOpts$a): Promise<Reply<'removeEnvironmentMember'>>;
10608
11803
  /** `POST /v1/environments/{id}/members/me/ssh-cert` — 12 h OpenSSH user certificate for your key. */
10609
- sshCert(envId: string, body: EnvironmentSshCertBody, opts?: CallOpts$8): Promise<EnvironmentSshCert>;
11804
+ sshCert(envId: string, body: EnvironmentSshCertBody, opts?: CallOpts$a): Promise<EnvironmentSshCert>;
10610
11805
  }
10611
11806
  /** `/v1/environments/{id}/tasks` — fire-and-forget agent tasks run in the environment. */
10612
11807
  declare class EnvironmentTasks {
10613
11808
  private readonly http;
10614
11809
  constructor(http: HttpClient);
10615
11810
  /** `GET /v1/environments/{id}/tasks` */
10616
- list(envId: string, opts?: CallOpts$8): Promise<EnvironmentTaskList>;
11811
+ list(envId: string, opts?: CallOpts$a): Promise<EnvironmentTaskList>;
10617
11812
  /** `POST /v1/environments/{id}/tasks` — queued; you get a notification when it finishes. */
10618
- create(envId: string, body: EnvironmentTaskCreateBody, opts?: CallOpts$8): Promise<EnvironmentTaskCreated>;
11813
+ create(envId: string, body: EnvironmentTaskCreateBody, opts?: CallOpts$a): Promise<EnvironmentTaskCreated>;
10619
11814
  /** `GET /v1/environments/{id}/tasks/{taskId}` */
10620
- get(envId: string, taskId: string, opts?: CallOpts$8): Promise<EnvironmentTaskDetail>;
11815
+ get(envId: string, taskId: string, opts?: CallOpts$a): Promise<EnvironmentTaskDetail>;
10621
11816
  }
10622
11817
  declare class EnvironmentPorts {
10623
11818
  private readonly http;
10624
11819
  constructor(http: HttpClient);
10625
11820
  /** `GET /v1/environments/{id}/ports` — published (forwarded) ports. */
10626
- list(envId: string, opts?: CallOpts$8): Promise<EnvironmentPort[]>;
11821
+ list(envId: string, opts?: CallOpts$a): Promise<EnvironmentPort[]>;
10627
11822
  /** `PUT /v1/environments/{id}/ports/{port}` — publish or change visibility (upsert). */
10628
- set(envId: string, port: number, body: EnvironmentPortBody, opts?: CallOpts$8): Promise<EnvironmentPort>;
11823
+ set(envId: string, port: number, body: EnvironmentPortBody, opts?: CallOpts$a): Promise<EnvironmentPort>;
10629
11824
  /** `DELETE /v1/environments/{id}/ports/{port}` — unpublish. */
10630
- remove(envId: string, port: number, opts?: CallOpts$8): Promise<Reply<'removeEnvironmentPort'>>;
11825
+ remove(envId: string, port: number, opts?: CallOpts$a): Promise<Reply<'removeEnvironmentPort'>>;
10631
11826
  }
10632
11827
  declare class EnvironmentSecrets {
10633
11828
  private readonly http;
10634
11829
  constructor(http: HttpClient);
10635
11830
  /** `GET /v1/environments/{id}/secrets` — names and timestamps only, never values. */
10636
- list(envId: string, opts?: CallOpts$8): Promise<EnvironmentSecret[]>;
11831
+ list(envId: string, opts?: CallOpts$a): Promise<EnvironmentSecret[]>;
10637
11832
  /** `PUT /v1/environments/{id}/secrets/{name}` — upsert; `name` is `ENV_STYLE`. */
10638
- set(envId: string, name: string, value: string, opts?: CallOpts$8): Promise<EnvironmentSecretSet>;
11833
+ set(envId: string, name: string, value: string, opts?: CallOpts$a): Promise<EnvironmentSecretSet>;
10639
11834
  /** `DELETE /v1/environments/{id}/secrets/{name}` */
10640
- remove(envId: string, name: string, opts?: CallOpts$8): Promise<Reply<'removeEnvironmentSecret'>>;
11835
+ remove(envId: string, name: string, opts?: CallOpts$a): Promise<Reply<'removeEnvironmentSecret'>>;
10641
11836
  }
10642
11837
  declare class Environments {
10643
11838
  private readonly http;
@@ -10647,39 +11842,39 @@ declare class Environments {
10647
11842
  readonly tasks: EnvironmentTasks;
10648
11843
  constructor(http: HttpClient);
10649
11844
  /** `GET /v1/environments/{id}/ssh-ca` — CA public keys to trust (`@cert-authority` lines). */
10650
- sshCa(envId: string, opts?: CallOpts$8): Promise<EnvironmentSshCa>;
11845
+ sshCa(envId: string, opts?: CallOpts$a): Promise<EnvironmentSshCa>;
10651
11846
  /** `GET /v1/environments?project_id=&for_user_id=me` — newest first, every state. */
10652
- list(query?: ListEnvironmentsQuery, opts?: CallOpts$8): Promise<Environment[]>;
11847
+ list(query?: ListEnvironmentsQuery, opts?: CallOpts$a): Promise<Environment[]>;
10653
11848
  /**
10654
11849
  * `POST /v1/environments` — `byo` starts `pending`; managed providers start
10655
11850
  * `creating`. 409 `already_has_env` in a `vm_per_dev` project (the error
10656
11851
  * body carries the `environment_id` to reuse).
10657
11852
  */
10658
- create(body: EnvironmentCreateBody, opts?: CallOpts$8): Promise<Environment>;
11853
+ create(body: EnvironmentCreateBody, opts?: CallOpts$a): Promise<Environment>;
10659
11854
  /**
10660
11855
  * `POST /v1/environments/enroll` — daemon side. The one-time `codai_env_…`
10661
11856
  * token in the body is the only credential; the client's API key header is
10662
11857
  * ignored by this route. Managed environments additionally receive a
10663
11858
  * freshly minted `api_key`, returned exactly once.
10664
11859
  */
10665
- enroll(body: EnvironmentEnrollBody, opts?: CallOpts$8): Promise<EnvironmentEnrolled>;
11860
+ enroll(body: EnvironmentEnrollBody, opts?: CallOpts$a): Promise<EnvironmentEnrolled>;
10666
11861
  /** `GET /v1/environments/{id}` — environment, your role, members, ports, recent events. */
10667
- get(envId: string, opts?: CallOpts$8): Promise<EnvironmentDetail>;
11862
+ get(envId: string, opts?: CallOpts$a): Promise<EnvironmentDetail>;
10668
11863
  /** `PATCH /v1/environments/{id}` — `name` and/or `idle_timeout_minutes` (5..1440). */
10669
- update(envId: string, body: EnvironmentPatchBody, opts?: CallOpts$8): Promise<Environment>;
11864
+ update(envId: string, body: EnvironmentPatchBody, opts?: CallOpts$a): Promise<Environment>;
10670
11865
  /** `POST /v1/environments/{id}/start` — managed providers only (`stopped` → `starting`). */
10671
- start(envId: string, opts?: CallOpts$8): Promise<EnvironmentTransition>;
11866
+ start(envId: string, opts?: CallOpts$a): Promise<EnvironmentTransition>;
10672
11867
  /** `POST /v1/environments/{id}/stop` — managed providers only (`running` → `stopping`). */
10673
- stop(envId: string, opts?: CallOpts$8): Promise<EnvironmentTransition>;
11868
+ stop(envId: string, opts?: CallOpts$a): Promise<EnvironmentTransition>;
10674
11869
  /** `POST /v1/environments/{id}/archive` — keeps history, releases the machine. */
10675
- archive(envId: string, opts?: CallOpts$8): Promise<EnvironmentTransition>;
11870
+ archive(envId: string, opts?: CallOpts$a): Promise<EnvironmentTransition>;
10676
11871
  /** `POST /v1/environments/{id}/destroy` — owner only; terminal. */
10677
- destroy(envId: string, opts?: CallOpts$8): Promise<EnvironmentTransition>;
11872
+ destroy(envId: string, opts?: CallOpts$a): Promise<EnvironmentTransition>;
10678
11873
  /**
10679
11874
  * `POST /v1/environments/{id}/enroll-token` — `byo` only; a 30-minute
10680
11875
  * one-time token for `enroll()`. Minting again replaces the previous one.
10681
11876
  */
10682
- enrollToken(envId: string, opts?: CallOpts$8): Promise<EnvironmentEnrollToken>;
11877
+ enrollToken(envId: string, opts?: CallOpts$a): Promise<EnvironmentEnrollToken>;
10683
11878
  private transition;
10684
11879
  }
10685
11880
 
@@ -10718,7 +11913,7 @@ type HostExecBody = Mutable<Body<'execOnHost'>>;
10718
11913
  type HostExecResponse = Reply<'execOnHost'>;
10719
11914
  type HostExecRequest = Schema<'HostExecRequest'>;
10720
11915
  type HostExecResultBody = Mutable<Body<'postHostExecResult'>>;
10721
- type CallOpts$7 = {
11916
+ type CallOpts$9 = {
10722
11917
  ext?: CodaiRequestExtensions;
10723
11918
  signal?: AbortSignal;
10724
11919
  };
@@ -10745,7 +11940,7 @@ declare class Hosts {
10745
11940
  private readonly http;
10746
11941
  constructor(http: HttpClient);
10747
11942
  /** `GET /v1/hosts` — your devices currently connected as hosts. */
10748
- list(opts?: CallOpts$7): Promise<HostPresence[]>;
11943
+ list(opts?: CallOpts$9): Promise<HostPresence[]>;
10749
11944
  /**
10750
11945
  * `POST /v1/hosts/{deviceId}/exec` — run one op on a connected host and
10751
11946
  * block until it answers (or `timeout_ms`, default 60 s).
@@ -10753,9 +11948,9 @@ declare class Hosts {
10753
11948
  exec(deviceId: string, op: HostOp, args?: Record<string, unknown>, extra?: {
10754
11949
  timeoutMs?: number;
10755
11950
  label?: string;
10756
- } & CallOpts$7): Promise<HostExecResponse>;
11951
+ } & CallOpts$9): Promise<HostExecResponse>;
10757
11952
  /** `POST /v1/hosts/exec/{reqId}/result` — host side: deliver an exec result. */
10758
- postResult(reqId: string, body: HostExecResultBody, opts?: CallOpts$7): Promise<Reply<'postHostExecResult'>>;
11953
+ postResult(reqId: string, body: HostExecResultBody, opts?: CallOpts$9): Promise<Reply<'postHostExecResult'>>;
10759
11954
  /**
10760
11955
  * `GET /v1/hosts/stream?os=&hostname=&roots=` — host side: announce this
10761
11956
  * device and receive `hello` / `ping` / `exec` events. Closed by the server
@@ -10765,7 +11960,56 @@ declare class Hosts {
10765
11960
  os?: string;
10766
11961
  hostname?: string;
10767
11962
  roots?: string[];
10768
- }, opts?: CallOpts$7): AsyncGenerator<HostStreamEvent, void, undefined>;
11963
+ }, opts?: CallOpts$9): AsyncGenerator<HostStreamEvent, void, undefined>;
11964
+ }
11965
+
11966
+ /**
11967
+ * `POST /v1/images/generations` and `POST /v1/images/edits` — Gemini image models on Vertex AI.
11968
+ * `codai-image` (default, gemini-3.1-flash-image, EU), `codai-image-fast`, `codai-image-pro`.
11969
+ * Output from the EU endpoint carries C2PA credentials + SynthID: keep the bytes as returned.
11970
+ */
11971
+
11972
+ type ImagesRequest = Mutable<Body<'createImage'>>;
11973
+ type ImagesResponse = Reply<'createImage'>;
11974
+ type ImageEditRequest = Mutable<Body<'editImage'>>;
11975
+ interface ImagesResult {
11976
+ /** Decoded image bytes, one per generated image (see `mimeTypes`). */
11977
+ images: Uint8Array[];
11978
+ /** MIME type of each entry in `images` (usually `image/png`). */
11979
+ mimeTypes: string[];
11980
+ raw: ImagesResponse;
11981
+ /** Upstream model that produced the images (`x-codai-routed-to`). */
11982
+ routedTo: string | null;
11983
+ /** Vertex location that processed the request, `eu` or `global` (`x-codai-data-region`). */
11984
+ dataRegion: string | null;
11985
+ /** Usage-based charge for this request in micro-USD (`x-codai-cost-micro-usd`). */
11986
+ costMicroUsd: number | null;
11987
+ headers: Headers;
11988
+ }
11989
+ declare class Images {
11990
+ private readonly http;
11991
+ constructor(http: HttpClient);
11992
+ /**
11993
+ * Generate images. Needs a real API key (ephemeral tokens are rejected).
11994
+ * Pass `reference_images` to keep a logo/palette/product consistent.
11995
+ */
11996
+ generate(body: Omit<ImagesRequest, 'model'> & {
11997
+ model?: string;
11998
+ }, opts?: {
11999
+ ext?: CodaiRequestExtensions;
12000
+ signal?: AbortSignal;
12001
+ }): Promise<ImagesResult>;
12002
+ /**
12003
+ * Edit one or more input images (`image`: one `{ b64_json, mime_type }` or an array of up to 14)
12004
+ * from a text instruction. JSON body; `mask` is not supported — describe the region in `prompt`.
12005
+ */
12006
+ edit(body: Omit<ImageEditRequest, 'model'> & {
12007
+ model?: string;
12008
+ }, opts?: {
12009
+ ext?: CodaiRequestExtensions;
12010
+ signal?: AbortSignal;
12011
+ }): Promise<ImagesResult>;
12012
+ private post;
10769
12013
  }
10770
12014
 
10771
12015
  /** `POST /v1/messages` — Anthropic Messages wire (JSON + named-event SSE). */
@@ -10839,7 +12083,7 @@ type Org = Schema<'OrgWithRole'>;
10839
12083
  type OrgMember = Schema<'OrgMember'>;
10840
12084
  type OrgRole = Schema<'OrgRole'>;
10841
12085
  type OrgAddMemberBody = Mutable<Body<'addOrgMember'>>;
10842
- type CallOpts$6 = {
12086
+ type CallOpts$8 = {
10843
12087
  ext?: CodaiRequestExtensions;
10844
12088
  signal?: AbortSignal;
10845
12089
  };
@@ -10847,20 +12091,20 @@ declare class OrgMembers {
10847
12091
  private readonly http;
10848
12092
  constructor(http: HttpClient);
10849
12093
  /** `GET /v1/orgs/{id}/members` */
10850
- list(orgId: string, opts?: CallOpts$6): Promise<OrgMember[]>;
12094
+ list(orgId: string, opts?: CallOpts$8): Promise<OrgMember[]>;
10851
12095
  /** `POST /v1/orgs/{id}/members` — add or re-role (owner/admin). */
10852
- add(orgId: string, body: OrgAddMemberBody, opts?: CallOpts$6): Promise<Reply<'addOrgMember', 201>>;
12096
+ add(orgId: string, body: OrgAddMemberBody, opts?: CallOpts$8): Promise<Reply<'addOrgMember', 201>>;
10853
12097
  /** `DELETE /v1/orgs/{id}/members/{userId}` */
10854
- remove(orgId: string, userId: string, opts?: CallOpts$6): Promise<Reply<'removeOrgMember'>>;
12098
+ remove(orgId: string, userId: string, opts?: CallOpts$8): Promise<Reply<'removeOrgMember'>>;
10855
12099
  }
10856
12100
  declare class Orgs {
10857
12101
  private readonly http;
10858
12102
  readonly members: OrgMembers;
10859
12103
  constructor(http: HttpClient);
10860
12104
  /** `POST /v1/orgs` */
10861
- create(name: string, opts?: CallOpts$6): Promise<Org>;
12105
+ create(name: string, opts?: CallOpts$8): Promise<Org>;
10862
12106
  /** `GET /v1/orgs` */
10863
- list(opts?: CallOpts$6): Promise<Org[]>;
12107
+ list(opts?: CallOpts$8): Promise<Org[]>;
10864
12108
  }
10865
12109
 
10866
12110
  /** `/v1/projects/*` — projects (a repo + isolation policy) that group environments. */
@@ -10870,7 +12114,7 @@ type ProjectIsolation = Schema<'ProjectIsolation'>;
10870
12114
  type ProjectCreateBody = Mutable<Body<'createProject'>>;
10871
12115
  type ProjectPatchBody = Mutable<Body<'updateProject'>>;
10872
12116
  type ProjectDetail = Reply<'getProject'>;
10873
- type CallOpts$5 = {
12117
+ type CallOpts$7 = {
10874
12118
  ext?: CodaiRequestExtensions;
10875
12119
  signal?: AbortSignal;
10876
12120
  };
@@ -10878,15 +12122,154 @@ declare class Projects {
10878
12122
  private readonly http;
10879
12123
  constructor(http: HttpClient);
10880
12124
  /** `GET /v1/projects` — projects you own plus those of your orgs, newest first. */
10881
- list(opts?: CallOpts$5): Promise<Project[]>;
12125
+ list(opts?: CallOpts$7): Promise<Project[]>;
10882
12126
  /** `POST /v1/projects` — 409 `slug_taken` when the slug is already yours. */
10883
- create(body: ProjectCreateBody, opts?: CallOpts$5): Promise<Project>;
12127
+ create(body: ProjectCreateBody, opts?: CallOpts$7): Promise<Project>;
10884
12128
  /** `GET /v1/projects/{id}` — the project plus every environment in it. */
10885
- get(projectId: string, opts?: CallOpts$5): Promise<ProjectDetail>;
12129
+ get(projectId: string, opts?: CallOpts$7): Promise<ProjectDetail>;
10886
12130
  /** `PATCH /v1/projects/{id}` — owner or org owner/admin; the slug cannot change. */
10887
- update(projectId: string, body: ProjectPatchBody, opts?: CallOpts$5): Promise<Project>;
12131
+ update(projectId: string, body: ProjectPatchBody, opts?: CallOpts$7): Promise<Project>;
10888
12132
  /** `DELETE /v1/projects/{id}` — 409 `project_has_environments` until all are destroyed. */
10889
- delete(projectId: string, opts?: CallOpts$5): Promise<Reply<'deleteProject'>>;
12133
+ delete(projectId: string, opts?: CallOpts$7): Promise<Reply<'deleteProject'>>;
12134
+ }
12135
+
12136
+ /**
12137
+ * `wss://…/v1/realtime` — dependency-free realtime client (live transcription and the OpenAI
12138
+ * Realtime protocol lanes). Not an OpenAPI operation (OpenAPI cannot describe WebSockets), so it is
12139
+ * outside the `OPERATION_METHODS` parity table.
12140
+ *
12141
+ * const live = codai.realtime.connect({ model: 'codai-transcribe-live', language: 'ro', token });
12142
+ * live.appendAudio(pcm16At24kHz); // Int16Array | ArrayBuffer | Uint8Array
12143
+ * for await (const ev of live) {
12144
+ * if (ev.type === 'conversation.item.input_audio_transcription.delta') draw(ev.delta);
12145
+ * }
12146
+ *
12147
+ * Uses the global `WebSocket` (browsers, Node ≥ 22, Deno, Bun) or an injected constructor.
12148
+ * - Browser path: pass an ephemeral `token` (scope `realtime` or `live`); it travels as `?key=`.
12149
+ * Raw `codai_` keys in the query string are refused by the gateway (close 4401).
12150
+ * - Server path: pass `apiKey` (or a token) with a WebSocket constructor that accepts headers
12151
+ * (e.g. `ws`); it is sent as `Authorization: Bearer` on the upgrade.
12152
+ */
12153
+ /** Minimal WebSocket surface (browser `WebSocket`, Node 22 global, or the `ws` package). */
12154
+ interface RealtimeSocket {
12155
+ readonly readyState: number;
12156
+ binaryType?: string;
12157
+ send(data: string | ArrayBuffer | ArrayBufferView): void;
12158
+ close(code?: number, reason?: string): void;
12159
+ onopen: ((ev: unknown) => void) | null;
12160
+ onmessage: ((ev: {
12161
+ data: unknown;
12162
+ }) => void) | null;
12163
+ onclose: ((ev: {
12164
+ code: number;
12165
+ reason: string;
12166
+ }) => void) | null;
12167
+ onerror: ((ev: unknown) => void) | null;
12168
+ }
12169
+ /** `new (url, protocols?, options?)` — the third argument is used for headers by `ws`. */
12170
+ type RealtimeSocketCtor = new (url: string, protocols?: string | string[], options?: {
12171
+ headers?: Record<string, string>;
12172
+ }) => RealtimeSocket;
12173
+ type RealtimeModel = 'codai-transcribe-live' | 'codai-realtime' | 'codai-voice' | (string & Record<never, never>);
12174
+ interface RealtimeConnectOptions {
12175
+ /** Default `codai-transcribe-live`. */
12176
+ model?: RealtimeModel;
12177
+ /** Language hint (`ro`, `en`, …). `ro` uses the Deepgram Nova-3 lane when the gateway has it. */
12178
+ language?: string;
12179
+ /** Ephemeral token (scope `realtime` or `live`) — sent as `?key=`. Required in browsers. */
12180
+ token?: string;
12181
+ /** Raw API key — sent as `Authorization: Bearer` (needs a ctor that supports headers). */
12182
+ apiKey?: string;
12183
+ /** Conversation id recorded on the usage row (`?session_id=`). */
12184
+ sessionId?: string;
12185
+ /**
12186
+ * First frame sent on open. Default for `codai-transcribe-live`: a transcription
12187
+ * `session.update` (PCM 24 kHz, `language` when set). Pass `null` to send nothing.
12188
+ */
12189
+ sessionUpdate?: Record<string, unknown> | null;
12190
+ /** Injectable WebSocket constructor (tests, `ws` on older Node). Defaults to `globalThis.WebSocket`. */
12191
+ WebSocket?: RealtimeSocketCtor;
12192
+ /** Override the gateway base URL (default: the client's `baseUrl`). */
12193
+ baseUrl?: string;
12194
+ }
12195
+ /** Typed subset of server events; anything else arrives as `RealtimeUnknownEvent`. */
12196
+ type RealtimeEvent = {
12197
+ type: 'session.created' | 'session.updated';
12198
+ session?: Record<string, unknown>;
12199
+ event_id?: string;
12200
+ } | {
12201
+ type: 'conversation.item.input_audio_transcription.delta';
12202
+ item_id: string;
12203
+ content_index?: number;
12204
+ delta: string;
12205
+ event_id?: string;
12206
+ } | {
12207
+ type: 'conversation.item.input_audio_transcription.completed';
12208
+ item_id: string;
12209
+ content_index?: number;
12210
+ transcript: string;
12211
+ event_id?: string;
12212
+ } | {
12213
+ type: 'input_audio_buffer.committed';
12214
+ item_id?: string;
12215
+ previous_item_id?: string | null;
12216
+ } | {
12217
+ type: 'input_audio_buffer.cleared';
12218
+ } | {
12219
+ type: 'error';
12220
+ error: {
12221
+ type?: string;
12222
+ code?: string;
12223
+ message?: string;
12224
+ };
12225
+ }
12226
+ /** Emitted by the client itself when the socket closes (always the last event). */
12227
+ | {
12228
+ type: 'close';
12229
+ code: number;
12230
+ reason: string;
12231
+ };
12232
+ type RealtimeUnknownEvent = {
12233
+ type: string;
12234
+ [k: string]: unknown;
12235
+ };
12236
+ type RealtimeAnyEvent = RealtimeEvent | RealtimeUnknownEvent;
12237
+ type Listener = (ev: RealtimeAnyEvent) => void;
12238
+ /** A live realtime session: async-iterable of events + `on()` listeners. */
12239
+ declare class RealtimeSession implements AsyncIterable<RealtimeAnyEvent> {
12240
+ readonly socket: RealtimeSocket;
12241
+ private readonly listeners;
12242
+ private readonly queue;
12243
+ private readonly waiters;
12244
+ private readonly outbox;
12245
+ private closed;
12246
+ /** Resolves when the socket is open (rejects if it closes first). */
12247
+ readonly ready: Promise<void>;
12248
+ constructor(socket: RealtimeSocket, firstFrame: Record<string, unknown> | null);
12249
+ /** Listen for one event type (`'*'` = every event). Returns an unsubscribe function. */
12250
+ on(type: string, fn: Listener): () => void;
12251
+ /** Send any client event (JSON). Queued until the socket opens. */
12252
+ send(event: Record<string, unknown>): void;
12253
+ /** Append PCM16 little-endian mono audio (24 kHz for `codai-transcribe-live`). */
12254
+ appendAudio(audio: Int16Array | ArrayBuffer | Uint8Array): void;
12255
+ /** Close the current utterance: the server answers with one `...transcription.completed`. */
12256
+ commit(): void;
12257
+ /** Drop audio the server holds for the current utterance. */
12258
+ clear(): void;
12259
+ close(code?: number, reason?: string): void;
12260
+ [Symbol.asyncIterator](): AsyncIterator<RealtimeAnyEvent>;
12261
+ private emit;
12262
+ }
12263
+ /** Build the `wss://…/v1/realtime?…` URL (exported for tests and custom transports). */
12264
+ declare function realtimeUrl(baseUrl: string, opts: RealtimeConnectOptions): string;
12265
+ declare class Realtime {
12266
+ private readonly defaults;
12267
+ constructor(defaults: {
12268
+ baseUrl: string;
12269
+ apiKey?: string;
12270
+ });
12271
+ /** Open a realtime session. Returns immediately; `await session.ready` to wait for the socket. */
12272
+ connect(opts?: RealtimeConnectOptions): RealtimeSession;
10890
12273
  }
10891
12274
 
10892
12275
  /**
@@ -10894,7 +12277,7 @@ declare class Projects {
10894
12277
  * Do not make direct changes to the file.
10895
12278
  */
10896
12279
  type paths = {
10897
- readonly '/health': {
12280
+ readonly "/health": {
10898
12281
  readonly parameters: {
10899
12282
  readonly query?: never;
10900
12283
  readonly header?: never;
@@ -10906,7 +12289,7 @@ type paths = {
10906
12289
  * @description Returns `{ ok: true, service: "codai-resolve" }` when the HTTP process is up. Does not
10907
12290
  * touch the database. The path is `/health` (not `/healthz`, which Google Frontend reserves).
10908
12291
  */
10909
- readonly get: operations['resolveHealth'];
12292
+ readonly get: operations["resolveHealth"];
10910
12293
  readonly put?: never;
10911
12294
  readonly post?: never;
10912
12295
  readonly delete?: never;
@@ -10915,7 +12298,7 @@ type paths = {
10915
12298
  readonly patch?: never;
10916
12299
  readonly trace?: never;
10917
12300
  };
10918
- readonly '/v1/resolve/attestations/{id}': {
12301
+ readonly "/v1/resolve/attestations/{id}": {
10919
12302
  readonly parameters: {
10920
12303
  readonly query?: never;
10921
12304
  readonly header?: never;
@@ -10931,7 +12314,29 @@ type paths = {
10931
12314
  * the URL only with people who may see the patch. `kind` is always
10932
12315
  * `codai.resolve.attestation.v0`.
10933
12316
  */
10934
- readonly get: operations['getResolveAttestation'];
12317
+ readonly get: operations["getResolveAttestation"];
12318
+ readonly put?: never;
12319
+ readonly post?: never;
12320
+ readonly delete?: never;
12321
+ readonly options?: never;
12322
+ readonly head?: never;
12323
+ readonly patch?: never;
12324
+ readonly trace?: never;
12325
+ };
12326
+ readonly "/v1/resolve/balance": {
12327
+ readonly parameters: {
12328
+ readonly query?: never;
12329
+ readonly header?: never;
12330
+ readonly path?: never;
12331
+ readonly cookie?: never;
12332
+ };
12333
+ /**
12334
+ * Fix credits, intro availability and wallet balance
12335
+ * @description Returns what you can pay with right now: the fix-credit balance (usable only on `t7`
12336
+ * jobs), whether the €1 intro price is still available (no verified paid job yet and no
12337
+ * other intro job in flight) and the wallet balance in EUR micros.
12338
+ */
12339
+ readonly get: operations["getResolveBalance"];
10935
12340
  readonly put?: never;
10936
12341
  readonly post?: never;
10937
12342
  readonly delete?: never;
@@ -10940,7 +12345,7 @@ type paths = {
10940
12345
  readonly patch?: never;
10941
12346
  readonly trace?: never;
10942
12347
  };
10943
- readonly '/v1/resolve/jobs': {
12348
+ readonly "/v1/resolve/jobs": {
10944
12349
  readonly parameters: {
10945
12350
  readonly query?: never;
10946
12351
  readonly header?: never;
@@ -10966,14 +12371,14 @@ type paths = {
10966
12371
  * otherwise valid payload. The free-tier claim is atomic per user, so parallel submissions
10967
12372
  * across several keys cannot exceed the 3 free resolves.
10968
12373
  */
10969
- readonly post: operations['createResolveJob'];
12374
+ readonly post: operations["createResolveJob"];
10970
12375
  readonly delete?: never;
10971
12376
  readonly options?: never;
10972
12377
  readonly head?: never;
10973
12378
  readonly patch?: never;
10974
12379
  readonly trace?: never;
10975
12380
  };
10976
- readonly '/v1/resolve/jobs/{id}': {
12381
+ readonly "/v1/resolve/jobs/{id}": {
10977
12382
  readonly parameters: {
10978
12383
  readonly query?: never;
10979
12384
  readonly header?: never;
@@ -10987,7 +12392,7 @@ type paths = {
10987
12392
  * Before answering, the server sweeps orphaned `accepted`/`running` jobs into `error`, so
10988
12393
  * you never poll a zombie. A job owned by another user is reported as `404` (not `403`).
10989
12394
  */
10990
- readonly get: operations['getResolveJob'];
12395
+ readonly get: operations["getResolveJob"];
10991
12396
  readonly put?: never;
10992
12397
  readonly post?: never;
10993
12398
  readonly delete?: never;
@@ -10996,7 +12401,7 @@ type paths = {
10996
12401
  readonly patch?: never;
10997
12402
  readonly trace?: never;
10998
12403
  };
10999
- readonly '/v1/resolve/jobs/{id}/accept': {
12404
+ readonly "/v1/resolve/jobs/{id}/accept": {
11000
12405
  readonly parameters: {
11001
12406
  readonly query?: never;
11002
12407
  readonly header?: never;
@@ -11016,15 +12421,20 @@ type paths = {
11016
12421
  * price). The hold is kept on a verified fix and refunded in full otherwise. If the
11017
12422
  * balance is short, the answer is `402 insufficient_funds` with the shortfall and a
11018
12423
  * top-up link, and the job stays `quoted` — top up, then call `/accept` again.
12424
+ *
12425
+ * Payment precedence: `intro` (first paid job, €1 hold) > `credit` (t7 only, one fix credit,
12426
+ * no wallet hold) > `wallet` (hold of the list price). `paid_with` in the response says which
12427
+ * was used; `held_micro_eur` is the wallet amount held (`0` for a credit). For a `t7` job the
12428
+ * `402` also carries `bundle_url` (10 fixes for €49).
11019
12429
  */
11020
- readonly post: operations['acceptResolveJob'];
12430
+ readonly post: operations["acceptResolveJob"];
11021
12431
  readonly delete?: never;
11022
12432
  readonly options?: never;
11023
12433
  readonly head?: never;
11024
12434
  readonly patch?: never;
11025
12435
  readonly trace?: never;
11026
12436
  };
11027
- readonly '/v1/resolve/keys': {
12437
+ readonly "/v1/resolve/keys": {
11028
12438
  readonly parameters: {
11029
12439
  readonly query?: never;
11030
12440
  readonly header?: never;
@@ -11039,7 +12449,7 @@ type paths = {
11039
12449
  * 1 hour. Verify with `codaid resolve verify`, `resolve.verifyAttestation` (TypeScript) or
11040
12450
  * `resolve.verify_attestation` (Python). `503` when signing is not configured.
11041
12451
  */
11042
- readonly get: operations['getResolveKeys'];
12452
+ readonly get: operations["getResolveKeys"];
11043
12453
  readonly put?: never;
11044
12454
  readonly post?: never;
11045
12455
  readonly delete?: never;
@@ -11053,10 +12463,16 @@ type components = {
11053
12463
  schemas: {
11054
12464
  /** Accepted */
11055
12465
  readonly ResolveAccepted: {
12466
+ /**
12467
+ * @description Amount held on the wallet in EUR micros — `1000000` for the intro, the quote for `wallet`, `0` for `credit`.
12468
+ * @example 1000000
12469
+ */
12470
+ readonly held_micro_eur: number;
11056
12471
  /** Format: uuid */
11057
12472
  readonly id: string;
12473
+ readonly paid_with: components["schemas"]["ResolvePaidWith"];
11058
12474
  /** @constant */
11059
- readonly status: 'accepted';
12475
+ readonly status: "accepted";
11060
12476
  };
11061
12477
  /**
11062
12478
  * Attestation
@@ -11071,7 +12487,7 @@ type components = {
11071
12487
  /** Format: uuid */
11072
12488
  readonly id: string;
11073
12489
  /** @constant */
11074
- readonly kind: 'codai.resolve.attestation.v0';
12490
+ readonly kind: "codai.resolve.attestation.v0";
11075
12491
  /** @description Unified diff against `base_commit`. */
11076
12492
  readonly patch: string;
11077
12493
  /** @description PASS_TO_PASS (repo suite) command, when one was run. */
@@ -11080,7 +12496,7 @@ type components = {
11080
12496
  /** Format: uri */
11081
12497
  readonly repo_url: string;
11082
12498
  /** @description `null` when the customer supplied `test_command`. */
11083
- readonly repro_test: components['schemas']['ResolveReproTest'] | null;
12499
+ readonly repro_test: components["schemas"]["ResolveReproTest"] | null;
11084
12500
  /** @description Container image digest of the verification runner (`unknown` when not recorded). */
11085
12501
  readonly runner_image_digest: string;
11086
12502
  /**
@@ -11089,7 +12505,7 @@ type components = {
11089
12505
  * attestations created before signing was enabled (2026-09-27). Verify against
11090
12506
  * `GET /v1/resolve/keys`.
11091
12507
  */
11092
- readonly signature: components['schemas']['ResolveAttestationEnvelope'] | null;
12508
+ readonly signature: components["schemas"]["ResolveAttestationEnvelope"] | null;
11093
12509
  /** Format: date-time */
11094
12510
  readonly started_at: string;
11095
12511
  /** @description FAIL_TO_PASS command that was executed. */
@@ -11115,7 +12531,7 @@ type components = {
11115
12531
  /** @description Base64 of the canonical statement JSON. */
11116
12532
  readonly payload: string;
11117
12533
  /** @constant */
11118
- readonly payloadType: 'application/vnd.codai.resolve.attestation+json;v=1';
12534
+ readonly payloadType: "application/vnd.codai.resolve.attestation+json;v=1";
11119
12535
  readonly signatures: readonly {
11120
12536
  /** @description Identifier of the signing key; matches `keyid` in `GET /v1/resolve/keys`. */
11121
12537
  readonly keyid?: string;
@@ -11123,6 +12539,24 @@ type components = {
11123
12539
  readonly sig: string;
11124
12540
  }[];
11125
12541
  };
12542
+ /**
12543
+ * Balance
12544
+ * @description Body of `GET /v1/resolve/balance`.
12545
+ */
12546
+ readonly ResolveBalance: {
12547
+ /**
12548
+ * @description Fix credits left (usable only on `t7` jobs). Buy 10 for €49 at https://pay.codai.ro/checkout?bundle=resolve10.
12549
+ * @example 10
12550
+ */
12551
+ readonly fix_credits: number;
12552
+ /** @description `true` while your next paid accept would hold the €1 intro price. */
12553
+ readonly intro_available: boolean;
12554
+ /**
12555
+ * @description Wallet balance in EUR micros (`5000000` = €5.00).
12556
+ * @example 5000000
12557
+ */
12558
+ readonly wallet_micro_eur: number;
12559
+ };
11126
12560
  /**
11127
12561
  * Declined
11128
12562
  * @description `200` body — triage declined the issue. The job is persisted with `status: declined` and is never billed.
@@ -11142,20 +12576,20 @@ type components = {
11142
12576
  /** Format: uuid */
11143
12577
  readonly id: string;
11144
12578
  /** @constant */
11145
- readonly status: 'declined';
12579
+ readonly status: "declined";
11146
12580
  };
11147
12581
  /**
11148
12582
  * Resolve error
11149
12583
  * @description Flat error envelope used by every Resolve endpoint. Not the gateway `{ error: { code, message } }` shape.
11150
12584
  */
11151
12585
  readonly ResolveError: {
11152
- readonly error: string | components['schemas']['ResolveValidationDetails'];
12586
+ readonly error: string | components["schemas"]["ResolveValidationDetails"];
11153
12587
  };
11154
12588
  readonly ResolveHealth: {
11155
12589
  /** @constant */
11156
12590
  readonly ok: true;
11157
12591
  /** @constant */
11158
- readonly service: 'codai-resolve';
12592
+ readonly service: "codai-resolve";
11159
12593
  };
11160
12594
  /**
11161
12595
  * Insufficient funds
@@ -11167,13 +12601,19 @@ type components = {
11167
12601
  * @example 5000000
11168
12602
  */
11169
12603
  readonly balance: number;
12604
+ /**
12605
+ * Format: uri
12606
+ * @description Present only for a `t7` job — checkout for the fix bundle (10 t7 fix credits for €49).
12607
+ * @example https://pay.codai.ro/checkout?bundle=resolve10
12608
+ */
12609
+ readonly bundle_url?: string;
11170
12610
  /**
11171
12611
  * @description Unit of `balance` and `required`.
11172
12612
  * @constant
11173
12613
  */
11174
- readonly currency: 'micro_eur';
12614
+ readonly currency: "micro_eur";
11175
12615
  /** @constant */
11176
- readonly error: 'insufficient_funds';
12616
+ readonly error: "insufficient_funds";
11177
12617
  /**
11178
12618
  * @description Amount the hold needs in EUR micros — the quote converted 1:1 (`19000000` = €19).
11179
12619
  * @example 19000000
@@ -11247,6 +12687,8 @@ type components = {
11247
12687
  readonly fail_reason: string | null;
11248
12688
  /** Format: uuid */
11249
12689
  readonly id: string;
12690
+ /** @description Present once the job was accepted (and recorded how it was paid). */
12691
+ readonly paid_with?: components["schemas"]["ResolvePaidWith"];
11250
12692
  /** @description Quoted price in USD micros; `null` until quoted, `0` on the free tier. */
11251
12693
  readonly quote_micro_usd: number | null;
11252
12694
  /**
@@ -11254,9 +12696,9 @@ type components = {
11254
12696
  * @description Normalised repository URL (trailing slash removed).
11255
12697
  */
11256
12698
  readonly repo_url: string;
11257
- readonly status: components['schemas']['ResolveJobStatus'];
12699
+ readonly status: components["schemas"]["ResolveJobStatus"];
11258
12700
  /** @description Quote tier; `null` until triage completes. */
11259
- readonly tier: components['schemas']['ResolveTier'] | null;
12701
+ readonly tier: components["schemas"]["ResolveTier"] | null;
11260
12702
  readonly triage_reason: string | null;
11261
12703
  };
11262
12704
  /**
@@ -11265,11 +12707,11 @@ type components = {
11265
12707
  * (triage refused) and `error` (infrastructure failure — retryable, never billed).
11266
12708
  * @enum {string}
11267
12709
  */
11268
- readonly ResolveJobStatus: 'triage' | 'quoted' | 'declined' | 'accepted' | 'running' | 'resolved' | 'failed' | 'error';
12710
+ readonly ResolveJobStatus: "triage" | "quoted" | "declined" | "accepted" | "running" | "resolved" | "failed" | "error";
11269
12711
  /** Verification key */
11270
12712
  readonly ResolveKey: {
11271
12713
  /** @constant */
11272
- readonly algorithm: 'ECDSA_P256_SHA256';
12714
+ readonly algorithm: "ECDSA_P256_SHA256";
11273
12715
  /**
11274
12716
  * @description Envelope and signature encoding.
11275
12717
  * @example DSSE v1; signature DER, base64
@@ -11278,14 +12720,22 @@ type components = {
11278
12720
  /** @description Key identifier (the Cloud KMS key version name). */
11279
12721
  readonly keyid: string;
11280
12722
  /** @constant */
11281
- readonly payload_type: 'application/vnd.codai.resolve.attestation+json;v=1';
12723
+ readonly payload_type: "application/vnd.codai.resolve.attestation+json;v=1";
11282
12724
  /** @description SPKI public key, PEM. */
11283
12725
  readonly public_key_pem: string;
11284
12726
  };
11285
12727
  /** Verification keys */
11286
12728
  readonly ResolveKeys: {
11287
- readonly keys: readonly components['schemas']['ResolveKey'][];
12729
+ readonly keys: readonly components["schemas"]["ResolveKey"][];
11288
12730
  };
12731
+ /**
12732
+ * Payment method
12733
+ * @description How an accepted job is paid: `free` (free tier), `intro` (first paid job, €1 hold),
12734
+ * `credit` (one t7 fix credit, no wallet hold) or `wallet` (hold of the list price).
12735
+ * Precedence: `free` > `intro` > `credit` > `wallet`.
12736
+ * @enum {string}
12737
+ */
12738
+ readonly ResolvePaidWith: "intro" | "credit" | "wallet" | "free";
11289
12739
  /**
11290
12740
  * Quote
11291
12741
  * @description `201` body — the job was quoted (`quoted`) or auto-accepted on the free tier (`accepted`).
@@ -11301,6 +12751,17 @@ type components = {
11301
12751
  readonly free_tier_remaining: number;
11302
12752
  /** Format: uuid */
11303
12753
  readonly id: string;
12754
+ /**
12755
+ * @description Present only on a `quoted` job while the intro price applies to you: accepting holds
12756
+ * this amount (EUR micros, `1000000` = €1) instead of the list price.
12757
+ * @example 1000000
12758
+ */
12759
+ readonly intro_price_micro_eur?: number;
12760
+ /**
12761
+ * @description Present together with `intro_price_micro_eur`; the regular hold in EUR micros (the quote 1:1).
12762
+ * @example 7000000
12763
+ */
12764
+ readonly list_price_micro_eur?: number;
11304
12765
  /**
11305
12766
  * @description Quoted price in USD micros (`7000000` = $7). `0` on the free tier.
11306
12767
  * @example 7000000
@@ -11310,8 +12771,8 @@ type components = {
11310
12771
  * @description `accepted` only when the free tier was used (already dispatched).
11311
12772
  * @enum {string}
11312
12773
  */
11313
- readonly status: 'quoted' | 'accepted';
11314
- readonly tier: components['schemas']['ResolveTier'];
12774
+ readonly status: "quoted" | "accepted";
12775
+ readonly tier: components["schemas"]["ResolveTier"];
11315
12776
  /** @description One-line triage rationale shown with the quote. */
11316
12777
  readonly triage_reason: string;
11317
12778
  };
@@ -11333,7 +12794,7 @@ type components = {
11333
12794
  * @description `free` (first 3 resolves per user), `t7` ($7), `t19` ($19), `t49` ($49). Prices are in USD micros on the wire.
11334
12795
  * @enum {string}
11335
12796
  */
11336
- readonly ResolveTier: 'free' | 't7' | 't19' | 't49';
12797
+ readonly ResolveTier: "free" | "t7" | "t19" | "t49";
11337
12798
  /**
11338
12799
  * Validation details
11339
12800
  * @description Zod `flatten()` output returned when the intake body fails schema validation.
@@ -11351,8 +12812,8 @@ type components = {
11351
12812
  * @description JSON body POSTed to `callback_url`. Verify `x-codai-signature` over the raw bytes before trusting it.
11352
12813
  */
11353
12814
  readonly ResolveWebhookEvent: {
11354
- readonly event: components['schemas']['ResolveWebhookEventName'];
11355
- readonly job: components['schemas']['ResolveWebhookJob'];
12815
+ readonly event: components["schemas"]["ResolveWebhookEventName"];
12816
+ readonly job: components["schemas"]["ResolveWebhookJob"];
11356
12817
  /**
11357
12818
  * Format: date-time
11358
12819
  * @description When this delivery attempt was built (UTC).
@@ -11364,7 +12825,7 @@ type components = {
11364
12825
  * @description `job.quoted` (paid quote ready), `job.declined` (triage refused), `job.resolved` (verified fix + attestation), `job.failed` (no verified fix, hold refunded), `job.error` (infrastructure failure, hold refunded).
11365
12826
  * @enum {string}
11366
12827
  */
11367
- readonly ResolveWebhookEventName: 'job.quoted' | 'job.declined' | 'job.resolved' | 'job.failed' | 'job.error';
12828
+ readonly ResolveWebhookEventName: "job.quoted" | "job.declined" | "job.resolved" | "job.failed" | "job.error";
11368
12829
  /**
11369
12830
  * Webhook job snapshot
11370
12831
  * @description Snapshot of the job at send time. Nullable fields are `null` until the corresponding stage has run.
@@ -11390,8 +12851,8 @@ type components = {
11390
12851
  readonly quote_micro_usd: number | null;
11391
12852
  /** Format: uri */
11392
12853
  readonly repo_url: string;
11393
- readonly status: components['schemas']['ResolveJobStatus'];
11394
- readonly tier: components['schemas']['ResolveTier'] | null;
12854
+ readonly status: components["schemas"]["ResolveJobStatus"];
12855
+ readonly tier: components["schemas"]["ResolveTier"] | null;
11395
12856
  };
11396
12857
  };
11397
12858
  responses: {
@@ -11406,7 +12867,7 @@ type components = {
11406
12867
  readonly [name: string]: unknown;
11407
12868
  };
11408
12869
  content: {
11409
- readonly 'application/json': components['schemas']['ResolveError'];
12870
+ readonly "application/json": components["schemas"]["ResolveError"];
11410
12871
  };
11411
12872
  };
11412
12873
  /** @description The job is not in the `quoted` state (`job is <status>, only quoted jobs can be accepted`). */
@@ -11415,20 +12876,21 @@ type components = {
11415
12876
  readonly [name: string]: unknown;
11416
12877
  };
11417
12878
  content: {
11418
- readonly 'application/json': components['schemas']['ResolveError'];
12879
+ readonly "application/json": components["schemas"]["ResolveError"];
11419
12880
  };
11420
12881
  };
11421
12882
  /**
11422
12883
  * @description The wallet balance does not cover the quote. Nothing was debited and the job is still
11423
12884
  * `quoted`. Open `topup_url` (pay.codai.ro checkout, shortfall rounded up to whole euros,
11424
- * minimum €10, maximum €1000), then retry `/accept`.
12885
+ * minimum €10, maximum €1000) — or, for a `t7` job, `bundle_url` (10 fix credits for €49) —
12886
+ * then retry `/accept`.
11425
12887
  */
11426
12888
  readonly ResolveInsufficientFunds: {
11427
12889
  headers: {
11428
12890
  readonly [name: string]: unknown;
11429
12891
  };
11430
12892
  content: {
11431
- readonly 'application/json': components['schemas']['ResolveInsufficientFunds'];
12893
+ readonly "application/json": components["schemas"]["ResolveInsufficientFunds"];
11432
12894
  };
11433
12895
  };
11434
12896
  /** @description The job row could not be inserted (`job insert failed`). */
@@ -11437,7 +12899,7 @@ type components = {
11437
12899
  readonly [name: string]: unknown;
11438
12900
  };
11439
12901
  content: {
11440
- readonly 'application/json': components['schemas']['ResolveError'];
12902
+ readonly "application/json": components["schemas"]["ResolveError"];
11441
12903
  };
11442
12904
  };
11443
12905
  /** @description No such job/attestation, or the job belongs to another user. */
@@ -11446,7 +12908,7 @@ type components = {
11446
12908
  readonly [name: string]: unknown;
11447
12909
  };
11448
12910
  content: {
11449
- readonly 'application/json': components['schemas']['ResolveError'];
12911
+ readonly "application/json": components["schemas"]["ResolveError"];
11450
12912
  };
11451
12913
  };
11452
12914
  /**
@@ -11459,7 +12921,7 @@ type components = {
11459
12921
  readonly [name: string]: unknown;
11460
12922
  };
11461
12923
  content: {
11462
- readonly 'application/json': components['schemas']['ResolveError'];
12924
+ readonly "application/json": components["schemas"]["ResolveError"];
11463
12925
  };
11464
12926
  };
11465
12927
  /** @description Missing, malformed or revoked API key (`invalid or missing API key`). */
@@ -11468,7 +12930,7 @@ type components = {
11468
12930
  readonly [name: string]: unknown;
11469
12931
  };
11470
12932
  content: {
11471
- readonly 'application/json': components['schemas']['ResolveError'];
12933
+ readonly "application/json": components["schemas"]["ResolveError"];
11472
12934
  };
11473
12935
  };
11474
12936
  };
@@ -11496,7 +12958,7 @@ interface operations {
11496
12958
  readonly [name: string]: unknown;
11497
12959
  };
11498
12960
  content: {
11499
- readonly 'application/json': components['schemas']['ResolveHealth'];
12961
+ readonly "application/json": components["schemas"]["ResolveHealth"];
11500
12962
  };
11501
12963
  };
11502
12964
  };
@@ -11519,10 +12981,31 @@ interface operations {
11519
12981
  readonly [name: string]: unknown;
11520
12982
  };
11521
12983
  content: {
11522
- readonly 'application/json': components['schemas']['ResolveAttestation'];
12984
+ readonly "application/json": components["schemas"]["ResolveAttestation"];
12985
+ };
12986
+ };
12987
+ readonly 404: components["responses"]["ResolveNotFound"];
12988
+ };
12989
+ };
12990
+ readonly getResolveBalance: {
12991
+ readonly parameters: {
12992
+ readonly query?: never;
12993
+ readonly header?: never;
12994
+ readonly path?: never;
12995
+ readonly cookie?: never;
12996
+ };
12997
+ readonly requestBody?: never;
12998
+ readonly responses: {
12999
+ /** @description Current balance. */
13000
+ readonly 200: {
13001
+ headers: {
13002
+ readonly [name: string]: unknown;
13003
+ };
13004
+ content: {
13005
+ readonly "application/json": components["schemas"]["ResolveBalance"];
11523
13006
  };
11524
13007
  };
11525
- readonly 404: components['responses']['ResolveNotFound'];
13008
+ readonly 401: components["responses"]["ResolveUnauthorized"];
11526
13009
  };
11527
13010
  };
11528
13011
  readonly createResolveJob: {
@@ -11534,7 +13017,7 @@ interface operations {
11534
13017
  };
11535
13018
  readonly requestBody: {
11536
13019
  readonly content: {
11537
- readonly 'application/json': components['schemas']['ResolveIntake'];
13020
+ readonly "application/json": components["schemas"]["ResolveIntake"];
11538
13021
  };
11539
13022
  };
11540
13023
  readonly responses: {
@@ -11544,7 +13027,7 @@ interface operations {
11544
13027
  readonly [name: string]: unknown;
11545
13028
  };
11546
13029
  content: {
11547
- readonly 'application/json': components['schemas']['ResolveDeclined'];
13030
+ readonly "application/json": components["schemas"]["ResolveDeclined"];
11548
13031
  };
11549
13032
  };
11550
13033
  /** @description Job created and quoted (or auto-accepted on the free tier). */
@@ -11553,13 +13036,13 @@ interface operations {
11553
13036
  readonly [name: string]: unknown;
11554
13037
  };
11555
13038
  content: {
11556
- readonly 'application/json': components['schemas']['ResolveQuote'];
13039
+ readonly "application/json": components["schemas"]["ResolveQuote"];
11557
13040
  };
11558
13041
  };
11559
- readonly 400: components['responses']['ResolveBadRequest'];
11560
- readonly 401: components['responses']['ResolveUnauthorized'];
11561
- readonly 429: components['responses']['ResolveRateLimited'];
11562
- readonly 500: components['responses']['ResolveInternalError'];
13042
+ readonly 400: components["responses"]["ResolveBadRequest"];
13043
+ readonly 401: components["responses"]["ResolveUnauthorized"];
13044
+ readonly 429: components["responses"]["ResolveRateLimited"];
13045
+ readonly 500: components["responses"]["ResolveInternalError"];
11563
13046
  };
11564
13047
  };
11565
13048
  readonly getResolveJob: {
@@ -11568,7 +13051,7 @@ interface operations {
11568
13051
  readonly header?: never;
11569
13052
  readonly path: {
11570
13053
  /** @description Job UUID returned by `POST /v1/resolve/jobs`. */
11571
- readonly id: components['parameters']['JobId'];
13054
+ readonly id: components["parameters"]["JobId"];
11572
13055
  };
11573
13056
  readonly cookie?: never;
11574
13057
  };
@@ -11580,11 +13063,11 @@ interface operations {
11580
13063
  readonly [name: string]: unknown;
11581
13064
  };
11582
13065
  content: {
11583
- readonly 'application/json': components['schemas']['ResolveJob'];
13066
+ readonly "application/json": components["schemas"]["ResolveJob"];
11584
13067
  };
11585
13068
  };
11586
- readonly 401: components['responses']['ResolveUnauthorized'];
11587
- readonly 404: components['responses']['ResolveNotFound'];
13069
+ readonly 401: components["responses"]["ResolveUnauthorized"];
13070
+ readonly 404: components["responses"]["ResolveNotFound"];
11588
13071
  };
11589
13072
  };
11590
13073
  readonly acceptResolveJob: {
@@ -11593,7 +13076,7 @@ interface operations {
11593
13076
  readonly header?: never;
11594
13077
  readonly path: {
11595
13078
  /** @description Job UUID returned by `POST /v1/resolve/jobs`. */
11596
- readonly id: components['parameters']['JobId'];
13079
+ readonly id: components["parameters"]["JobId"];
11597
13080
  };
11598
13081
  readonly cookie?: never;
11599
13082
  };
@@ -11605,13 +13088,13 @@ interface operations {
11605
13088
  readonly [name: string]: unknown;
11606
13089
  };
11607
13090
  content: {
11608
- readonly 'application/json': components['schemas']['ResolveAccepted'];
13091
+ readonly "application/json": components["schemas"]["ResolveAccepted"];
11609
13092
  };
11610
13093
  };
11611
- readonly 401: components['responses']['ResolveUnauthorized'];
11612
- readonly 402: components['responses']['ResolveInsufficientFunds'];
11613
- readonly 404: components['responses']['ResolveNotFound'];
11614
- readonly 409: components['responses']['ResolveConflict'];
13094
+ readonly 401: components["responses"]["ResolveUnauthorized"];
13095
+ readonly 402: components["responses"]["ResolveInsufficientFunds"];
13096
+ readonly 404: components["responses"]["ResolveNotFound"];
13097
+ readonly 409: components["responses"]["ResolveConflict"];
11615
13098
  };
11616
13099
  };
11617
13100
  readonly getResolveKeys: {
@@ -11629,7 +13112,7 @@ interface operations {
11629
13112
  readonly [name: string]: unknown;
11630
13113
  };
11631
13114
  content: {
11632
- readonly 'application/json': components['schemas']['ResolveKeys'];
13115
+ readonly "application/json": components["schemas"]["ResolveKeys"];
11633
13116
  };
11634
13117
  };
11635
13118
  /** @description Attestation signing is not configured (`attestation signing not configured`). */
@@ -11638,7 +13121,7 @@ interface operations {
11638
13121
  readonly [name: string]: unknown;
11639
13122
  };
11640
13123
  content: {
11641
- readonly 'application/json': components['schemas']['ResolveError'];
13124
+ readonly "application/json": components["schemas"]["ResolveError"];
11642
13125
  };
11643
13126
  };
11644
13127
  };
@@ -11648,18 +13131,18 @@ interface operations {
11648
13131
  readonly query?: never;
11649
13132
  readonly header: {
11650
13133
  /** @description Idempotency key `<jobId>:<event>`, identical on every retry. */
11651
- readonly 'x-codai-delivery': string;
13134
+ readonly "x-codai-delivery": string;
11652
13135
  /** @description Event name, same as `event` in the body. */
11653
- readonly 'x-codai-event': components['schemas']['ResolveWebhookEventName'];
13136
+ readonly "x-codai-event": components["schemas"]["ResolveWebhookEventName"];
11654
13137
  /** @description `t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">`. */
11655
- readonly 'x-codai-signature': string;
13138
+ readonly "x-codai-signature": string;
11656
13139
  };
11657
13140
  readonly path?: never;
11658
13141
  readonly cookie?: never;
11659
13142
  };
11660
13143
  readonly requestBody: {
11661
13144
  readonly content: {
11662
- readonly 'application/json': components['schemas']['ResolveWebhookEvent'];
13145
+ readonly "application/json": components["schemas"]["ResolveWebhookEvent"];
11663
13146
  };
11664
13147
  };
11665
13148
  readonly responses: {
@@ -11690,6 +13173,10 @@ type ResolveDeclined = ResolveSchemas['ResolveDeclined'];
11690
13173
  /** `submit()` result: `201` quote / free-tier auto-accept, or `200` decline. */
11691
13174
  type ResolveSubmitResult = ResolveQuote | ResolveDeclined;
11692
13175
  type ResolveAccepted = ResolveSchemas['ResolveAccepted'];
13176
+ /** How an accepted job is paid: `free` > `intro` (€1) > `credit` (t7 fix credit) > `wallet`. */
13177
+ type ResolvePaidWith = ResolveSchemas['ResolvePaidWith'];
13178
+ /** `GET /v1/resolve/balance` — fix credits, intro availability, wallet (EUR micros). */
13179
+ type ResolveBalance = ResolveSchemas['ResolveBalance'];
11693
13180
  type ResolveJob = ResolveSchemas['ResolveJob'];
11694
13181
  type ResolveJobStatus = ResolveSchemas['ResolveJobStatus'];
11695
13182
  type ResolveTier = ResolveSchemas['ResolveTier'];
@@ -11762,6 +13249,8 @@ declare class ResolveInsufficientFundsError extends ResolveError {
11762
13249
  readonly currency: 'micro_eur';
11763
13250
  /** pay.codai.ro checkout link for the shortfall — open it, then retry `accept()`. */
11764
13251
  readonly topupUrl: string;
13252
+ /** Present only for a `t7` job: fix-bundle checkout (10 t7 fix credits for €49). */
13253
+ readonly bundleUrl?: string;
11765
13254
  constructor(message: string, body: ResolveInsufficientFunds, meta?: {
11766
13255
  requestId?: string | null;
11767
13256
  });
@@ -11777,7 +13266,7 @@ interface ResolveWaitOptions {
11777
13266
  /** Called with every polled job (progress UIs). */
11778
13267
  onPoll?: (job: ResolveJob) => void;
11779
13268
  }
11780
- type CallOpts$4 = {
13269
+ type CallOpts$6 = {
11781
13270
  signal?: AbortSignal;
11782
13271
  };
11783
13272
  declare class Resolve {
@@ -11789,24 +13278,28 @@ declare class Resolve {
11789
13278
  * (`status: 'accepted'`) or a decline (`status: 'declined'`). Never retried:
11790
13279
  * a retry could create a second job.
11791
13280
  */
11792
- submit(body: ResolveIntake, opts?: CallOpts$4): Promise<ResolveSubmitResult>;
13281
+ submit(body: ResolveIntake, opts?: CallOpts$6): Promise<ResolveSubmitResult>;
11793
13282
  /** `GET /v1/resolve/jobs/{id}` — status, quote, reasons, cost and attestation pointer. */
11794
- get(id: string, opts?: CallOpts$4): Promise<ResolveJob>;
13283
+ get(id: string, opts?: CallOpts$6): Promise<ResolveJob>;
11795
13284
  /**
11796
13285
  * `POST /v1/resolve/jobs/{id}/accept` — accept a paid quote and start the job.
11797
- * Throws `ResolveInsufficientFundsError` (402, carries `topupUrl`) when the
11798
- * wallet is short, `ResolveError` 409 when the job is not `quoted`.
13286
+ * The result's `paid_with` says how it was paid (`intro` €1 hold, `credit`
13287
+ * t7 fix credit, or `wallet`). Throws `ResolveInsufficientFundsError` (402,
13288
+ * carries `topupUrl`, plus `bundleUrl` for t7) when the wallet is short,
13289
+ * `ResolveError` 409 when the job is not `quoted`.
11799
13290
  */
11800
- accept(id: string, opts?: CallOpts$4): Promise<ResolveAccepted>;
13291
+ accept(id: string, opts?: CallOpts$6): Promise<ResolveAccepted>;
11801
13292
  /**
11802
13293
  * `GET /v1/resolve/attestations/{id}` — public execution proof (no auth needed
11803
13294
  * server-side). Accepts the attestation id or the job's `attestation_url`.
11804
13295
  */
11805
- attestation(idOrUrl: string, opts?: CallOpts$4): Promise<ResolveAttestation>;
13296
+ attestation(idOrUrl: string, opts?: CallOpts$6): Promise<ResolveAttestation>;
11806
13297
  /** `GET /health` — liveness of the Resolve service. */
11807
- health(opts?: CallOpts$4): Promise<ResolveHealth>;
13298
+ health(opts?: CallOpts$6): Promise<ResolveHealth>;
13299
+ /** `GET /v1/resolve/balance` — fix credits (t7 only), intro availability and wallet balance. */
13300
+ balance(opts?: CallOpts$6): Promise<ResolveBalance>;
11808
13301
  /** `GET /v1/resolve/keys` — public keys that sign attestations (no auth needed server-side). */
11809
- keys(opts?: CallOpts$4): Promise<ResolveKeys>;
13302
+ keys(opts?: CallOpts$6): Promise<ResolveKeys>;
11810
13303
  /**
11811
13304
  * Verify an attestation's signature and that the signed statement matches
11812
13305
  * its fields. Fetches `keys()` unless `opts.keys` is given (pin them to
@@ -11893,7 +13386,21 @@ type SessionEventsPage = Reply<'listSessionEvents'>;
11893
13386
  type SessionControl = Schema<'SessionControl'>;
11894
13387
  type SessionControlRequest = Mutable<Body<'submitSessionControl'>>;
11895
13388
  type SessionControlAccepted = Reply<'submitSessionControl', 202>;
11896
- type SessionDispatchRequest = Mutable<Body<'dispatchToDevice'>>;
13389
+ type SessionDispatchBase = Omit<Mutable<Body<'dispatchToDevice'>>, 'mode' | 'text' | 'turn_id'>;
13390
+ /**
13391
+ * `POST …/dispatch` body. `send` (the default) needs `text` and runs it as a new turn on the
13392
+ * target; `open` is a handoff — the target only opens the session, so it takes no text/turn.
13393
+ */
13394
+ type SessionDispatchRequest = (SessionDispatchBase & {
13395
+ mode?: 'send';
13396
+ text: string;
13397
+ turn_id?: string;
13398
+ }) | (SessionDispatchBase & {
13399
+ mode: 'open';
13400
+ text?: never;
13401
+ turn_id?: never;
13402
+ });
13403
+ type SessionDispatchMode = NonNullable<Body<'dispatchToDevice'>['mode']>;
11897
13404
  type SessionDispatchResponse = Reply<'dispatchToDevice', 202>;
11898
13405
  type SessionLeaseClaimRequest = Mutable<Body<'claimSessionLease'>>;
11899
13406
  type SessionLeaseResponse = Reply<'claimSessionLease'>;
@@ -11901,7 +13408,7 @@ type SessionShare = Schema<'OrgSessionShare'>;
11901
13408
  type SessionShareCreateRequest = Mutable<Body<'createSessionShare'>>;
11902
13409
  type SessionShareCreated = Reply<'createSessionShare', 201>;
11903
13410
  type SharedSession = Schema<'OrgSharedSession'>;
11904
- type CallOpts$3 = {
13411
+ type CallOpts$5 = {
11905
13412
  ext?: CodaiRequestExtensions;
11906
13413
  signal?: AbortSignal;
11907
13414
  };
@@ -11948,19 +13455,19 @@ declare class SessionLease {
11948
13455
  private readonly http;
11949
13456
  constructor(http: HttpClient);
11950
13457
  /** `POST /v1/sessions/{id}/lease` — CAS claim; `force: true` takes over a live lease. */
11951
- acquire(sessionId: string, body?: SessionLeaseClaimRequest, opts?: CallOpts$3): Promise<SessionLeaseResponse>;
13458
+ acquire(sessionId: string, body?: SessionLeaseClaimRequest, opts?: CallOpts$5): Promise<SessionLeaseResponse>;
11952
13459
  /** `PUT /v1/sessions/{id}/lease` — heartbeat every 10 s (TTL 30 s). */
11953
- renew(sessionId: string, opts?: CallOpts$3): Promise<SessionLeaseResponse>;
13460
+ renew(sessionId: string, opts?: CallOpts$5): Promise<SessionLeaseResponse>;
11954
13461
  /** `DELETE /v1/sessions/{id}/lease` */
11955
- release(sessionId: string, opts?: CallOpts$3): Promise<Reply<'releaseSessionLease'>>;
13462
+ release(sessionId: string, opts?: CallOpts$5): Promise<Reply<'releaseSessionLease'>>;
11956
13463
  }
11957
13464
  declare class SessionEvents {
11958
13465
  private readonly http;
11959
13466
  constructor(http: HttpClient);
11960
13467
  /** `GET /v1/sessions/{id}/events?after=&limit=` */
11961
- list(sessionId: string, query?: Mutable<QueryOf<'listSessionEvents'>>, opts?: CallOpts$3): Promise<SessionEventsPage>;
13468
+ list(sessionId: string, query?: Mutable<QueryOf<'listSessionEvents'>>, opts?: CallOpts$5): Promise<SessionEventsPage>;
11962
13469
  /** `POST /v1/sessions/{id}/events` — executor only (needs the live lease). */
11963
- append(sessionId: string, body: SessionEventsAppendRequest, opts?: CallOpts$3): Promise<SessionEventsAppendResponse>;
13470
+ append(sessionId: string, body: SessionEventsAppendRequest, opts?: CallOpts$5): Promise<SessionEventsAppendResponse>;
11964
13471
  }
11965
13472
  declare class SessionControls {
11966
13473
  private readonly http;
@@ -11969,25 +13476,25 @@ declare class SessionControls {
11969
13476
  list(sessionId: string, query?: {
11970
13477
  applied?: boolean;
11971
13478
  target?: 'me' | string;
11972
- }, opts?: CallOpts$3): Promise<SessionControl[]>;
13479
+ }, opts?: CallOpts$5): Promise<SessionControl[]>;
11973
13480
  /** `POST /v1/sessions/{id}/control` — send a control to the executor (editor+). */
11974
- submit(sessionId: string, body: SessionControlRequest, opts?: CallOpts$3): Promise<SessionControlAccepted>;
13481
+ submit(sessionId: string, body: SessionControlRequest, opts?: CallOpts$5): Promise<SessionControlAccepted>;
11975
13482
  /** `POST /v1/sessions/{id}/control/{cid}/applied` — executor only. */
11976
- markApplied(sessionId: string, controlId: string, opts?: CallOpts$3): Promise<Reply<'markSessionControlApplied'>>;
13483
+ markApplied(sessionId: string, controlId: string, opts?: CallOpts$5): Promise<Reply<'markSessionControlApplied'>>;
11977
13484
  }
11978
13485
  declare class SessionShares {
11979
13486
  private readonly http;
11980
13487
  constructor(http: HttpClient);
11981
13488
  /** `GET /v1/sessions/{id}/shares` — owner only. */
11982
- list(sessionId: string, opts?: CallOpts$3): Promise<SessionShare[]>;
13489
+ list(sessionId: string, opts?: CallOpts$5): Promise<SessionShare[]>;
11983
13490
  /** `POST /v1/sessions/{id}/shares` — `token` is returned once for link shares. */
11984
- create(sessionId: string, body: SessionShareCreateRequest, opts?: CallOpts$3): Promise<SessionShareCreated>;
13491
+ create(sessionId: string, body: SessionShareCreateRequest, opts?: CallOpts$5): Promise<SessionShareCreated>;
11985
13492
  /** `DELETE /v1/sessions/{id}/shares/{shareId}` */
11986
- delete(sessionId: string, shareId: string, opts?: CallOpts$3): Promise<Reply<'deleteSessionShare'>>;
13493
+ delete(sessionId: string, shareId: string, opts?: CallOpts$5): Promise<Reply<'deleteSessionShare'>>;
11987
13494
  /** `GET /v1/sessions/shared-with-me` */
11988
13495
  sharedWithMe(query?: {
11989
13496
  archived?: boolean;
11990
- }, opts?: CallOpts$3): Promise<SharedSession[]>;
13497
+ }, opts?: CallOpts$5): Promise<SharedSession[]>;
11991
13498
  }
11992
13499
  declare class Sessions {
11993
13500
  private readonly http;
@@ -11997,24 +13504,27 @@ declare class Sessions {
11997
13504
  readonly shares: SessionShares;
11998
13505
  constructor(http: HttpClient);
11999
13506
  /** `POST /v1/sessions` — idempotent on `session_key` (200 existing / 201 created). */
12000
- create(body?: SessionCreateRequest, opts?: CallOpts$3): Promise<Session & {
13507
+ create(body?: SessionCreateRequest, opts?: CallOpts$5): Promise<Session & {
12001
13508
  created: boolean;
12002
13509
  }>;
12003
13510
  /** `GET /v1/sessions?limit=&archived=` — own sessions first, then shared. */
12004
13511
  list(query?: {
12005
13512
  limit?: number;
12006
13513
  archived?: boolean;
12007
- }, opts?: CallOpts$3): Promise<SessionListItem[]>;
13514
+ }, opts?: CallOpts$5): Promise<SessionListItem[]>;
12008
13515
  /** `GET /v1/sessions/{id}` — detail with members, lease and presence. */
12009
13516
  get(sessionId: string, query?: {
12010
13517
  share?: string;
12011
- }, opts?: CallOpts$3): Promise<SessionDetail>;
13518
+ }, opts?: CallOpts$5): Promise<SessionDetail>;
12012
13519
  /** `PATCH /v1/sessions/{id}` — rename / archive (owner). */
12013
- update(sessionId: string, body: SessionPatchRequest, opts?: CallOpts$3): Promise<Session>;
13520
+ update(sessionId: string, body: SessionPatchRequest, opts?: CallOpts$5): Promise<Session>;
12014
13521
  /** `DELETE /v1/sessions/{id}` — irreversible (owner). */
12015
- delete(sessionId: string, opts?: CallOpts$3): Promise<Reply<'deleteSession'>>;
12016
- /** `POST /v1/sessions/{id}/dispatch` — queue a `send` for one device and wake it over FCM. */
12017
- dispatch(sessionId: string, body: SessionDispatchRequest, opts?: CallOpts$3): Promise<SessionDispatchResponse>;
13522
+ delete(sessionId: string, opts?: CallOpts$5): Promise<Reply<'deleteSession'>>;
13523
+ /**
13524
+ * `POST /v1/sessions/{id}/dispatch` — queue a `send` for one device and wake it over FCM.
13525
+ * `{ mode: 'open' }` hands the session off instead: the target just opens it (no user turn).
13526
+ */
13527
+ dispatch(sessionId: string, body: SessionDispatchRequest, opts?: CallOpts$5): Promise<SessionDispatchResponse>;
12018
13528
  /**
12019
13529
  * `GET /v1/sessions/{id}/stream?after=` — live SSE of `event` / `control` /
12020
13530
  * `lease` / `presence` frames. `: ping` heartbeats are skipped. The server
@@ -12023,24 +13533,61 @@ declare class Sessions {
12023
13533
  stream(sessionId: string, query?: {
12024
13534
  after?: number;
12025
13535
  share?: string;
12026
- }, opts?: CallOpts$3): AsyncGenerator<SessionStreamEvent, void, undefined>;
13536
+ }, opts?: CallOpts$5): AsyncGenerator<SessionStreamEvent, void, undefined>;
12027
13537
  }
12028
13538
 
12029
13539
  /** `POST /v1/systemone` — typed decisions from codai-s1 (Choice / Score / Noul). */
12030
13540
 
12031
13541
  type SystemOneRequest = Mutable<Body<'createSystemOne'>>;
12032
13542
  type SystemOneResponse = Reply<'createSystemOne'>;
13543
+ type SystemOneState = NonNullable<SystemOneRequest['state']>;
13544
+ type SystemOneAnswers = NonNullable<SystemOneResponse['answers']>;
13545
+ /** Single-state call: `answers` is always present. */
13546
+ type SystemOneSingleRequest = Omit<SystemOneRequest, 'items'> & {
13547
+ state: SystemOneState;
13548
+ };
13549
+ type SystemOneSingleResponse = SystemOneResponse & {
13550
+ answers: SystemOneAnswers;
13551
+ };
13552
+ /** Batch call (1-16 items, same questions, run concurrently). */
13553
+ type SystemOneBatchRequest = Omit<SystemOneRequest, 'state' | 'items'> & {
13554
+ items: Array<{
13555
+ id: string;
13556
+ state: SystemOneState;
13557
+ }>;
13558
+ };
13559
+ type SystemOneBatchResponse = SystemOneResponse & {
13560
+ items: Array<{
13561
+ id: string;
13562
+ answers: SystemOneAnswers;
13563
+ }>;
13564
+ };
12033
13565
  declare class SystemOne {
12034
13566
  private readonly http;
12035
13567
  constructor(http: HttpClient);
12036
13568
  /**
12037
- * Ask one or more typed questions about `state`. Throws on 503 `s1_unavailable` like any other
12038
- * error — keep a local fallback and catch it: the gateway never substitutes a generative model.
13569
+ * Ask one or more typed questions about `state` (or about each of `items`). Throws on 503
13570
+ * `s1_unavailable` like any other error — keep a local fallback and catch it. The gateway
13571
+ * substitutes a generative model ONLY when you pass `fallback: 'codai-fast'`, and then the
13572
+ * response says `fallback_used: true`. `timeout_ms` (100-5000) bounds the s1 call.
12039
13573
  */
13574
+ create(body: SystemOneSingleRequest, opts?: {
13575
+ ext?: CodaiRequestExtensions;
13576
+ signal?: AbortSignal;
13577
+ }): Promise<SystemOneSingleResponse>;
13578
+ create(body: SystemOneBatchRequest, opts?: {
13579
+ ext?: CodaiRequestExtensions;
13580
+ signal?: AbortSignal;
13581
+ }): Promise<SystemOneBatchResponse>;
12040
13582
  create(body: SystemOneRequest, opts?: {
12041
13583
  ext?: CodaiRequestExtensions;
12042
13584
  signal?: AbortSignal;
12043
13585
  }): Promise<SystemOneResponse>;
13586
+ /** Same questions about up to 16 states in one call; results come back in `items` order. */
13587
+ batch(body: SystemOneBatchRequest, opts?: {
13588
+ ext?: CodaiRequestExtensions;
13589
+ signal?: AbortSignal;
13590
+ }): Promise<SystemOneBatchResponse>;
12044
13591
  }
12045
13592
 
12046
13593
  /** `/v1/tasks/*` — outcome-billing task lifecycle. */
@@ -12052,7 +13599,7 @@ type TaskListPage = Reply<'listTasks'>;
12052
13599
  type TaskConfirmRequest = Mutable<Body<'confirmTask'>>;
12053
13600
  type TaskConfirmResponse = Reply<'confirmTask'>;
12054
13601
  type TaskListQuery = Mutable<QueryOf<'listTasks'>>;
12055
- type CallOpts$2 = {
13602
+ type CallOpts$4 = {
12056
13603
  ext?: CodaiRequestExtensions;
12057
13604
  signal?: AbortSignal;
12058
13605
  };
@@ -12060,15 +13607,15 @@ declare class Tasks {
12060
13607
  private readonly http;
12061
13608
  constructor(http: HttpClient);
12062
13609
  /** `GET /v1/tasks` — newest first; page with `cursor` = previous `next_cursor`. */
12063
- list(query?: TaskListQuery, opts?: CallOpts$2): Promise<TaskListPage>;
13610
+ list(query?: TaskListQuery, opts?: CallOpts$4): Promise<TaskListPage>;
12064
13611
  /** `GET /v1/tasks/pending` — tasks awaiting your confirmation (max 100). */
12065
- pending(opts?: CallOpts$2): Promise<Task[]>;
13612
+ pending(opts?: CallOpts$4): Promise<Task[]>;
12066
13613
  /** `GET /v1/tasks/stats?since=` */
12067
- stats(since?: string | Date, opts?: CallOpts$2): Promise<TaskStats>;
13614
+ stats(since?: string | Date, opts?: CallOpts$4): Promise<TaskStats>;
12068
13615
  /** `GET /v1/tasks/{id}` */
12069
- get(id: string, opts?: CallOpts$2): Promise<Task>;
13616
+ get(id: string, opts?: CallOpts$4): Promise<Task>;
12070
13617
  /** `POST /v1/tasks/{id}/confirm` — answer "Did codai solve it?". */
12071
- confirm(id: string, body: TaskConfirmRequest, opts?: CallOpts$2): Promise<TaskConfirmResponse>;
13618
+ confirm(id: string, body: TaskConfirmRequest, opts?: CallOpts$4): Promise<TaskConfirmResponse>;
12072
13619
  }
12073
13620
 
12074
13621
  /** `/v1/triggers/*` + `/v1/notifications/*` — event triggers (webhooks → agent sessions) and the inbox. */
@@ -12087,7 +13634,7 @@ type NotificationsRead = Reply<'markNotificationsRead'>;
12087
13634
  type NotificationsDeleted = {
12088
13635
  readonly deleted: number;
12089
13636
  };
12090
- type CallOpts$1 = {
13637
+ type CallOpts$3 = {
12091
13638
  ext?: CodaiRequestExtensions;
12092
13639
  signal?: AbortSignal;
12093
13640
  };
@@ -12095,22 +13642,22 @@ declare class Triggers {
12095
13642
  private readonly http;
12096
13643
  constructor(http: HttpClient);
12097
13644
  /** `GET /v1/triggers` — never includes the signing secret. */
12098
- list(opts?: CallOpts$1): Promise<TriggerList>;
13645
+ list(opts?: CallOpts$3): Promise<TriggerList>;
12099
13646
  /** `POST /v1/triggers` — the response carries the signing `secret` ONCE. */
12100
- create(body: TriggerCreateRequest, opts?: CallOpts$1): Promise<TriggerCreated>;
13647
+ create(body: TriggerCreateRequest, opts?: CallOpts$3): Promise<TriggerCreated>;
12101
13648
  /** `PATCH /v1/triggers/{id}` — name / enabled / policy. */
12102
- update(id: string, body: TriggerPatch, opts?: CallOpts$1): Promise<TriggerUpdated>;
13649
+ update(id: string, body: TriggerPatch, opts?: CallOpts$3): Promise<TriggerUpdated>;
12103
13650
  /** `DELETE /v1/triggers/{id}` — its hook URL stops working immediately. */
12104
- delete(id: string, opts?: CallOpts$1): Promise<Reply<'deleteTrigger'>>;
13651
+ delete(id: string, opts?: CallOpts$3): Promise<Reply<'deleteTrigger'>>;
12105
13652
  /** `POST /v1/triggers/{id}/rotate-secret` — new secret, shown once. */
12106
- rotateSecret(id: string, opts?: CallOpts$1): Promise<Reply<'rotateTriggerSecret'>>;
13653
+ rotateSecret(id: string, opts?: CallOpts$3): Promise<Reply<'rotateTriggerSecret'>>;
12107
13654
  /** `POST /v1/triggers/{id}/test` — manual fire through the full pipeline; returns the decision + reason. */
12108
13655
  /** `PUT /v1/triggers/{id}/secret` — store a secret issued by the source (e.g. a Sentry integration's client secret). */
12109
- setSecret(id: string, secret: string, opts?: CallOpts$1): Promise<Reply<'setTriggerSecret'>>;
13656
+ setSecret(id: string, secret: string, opts?: CallOpts$3): Promise<Reply<'setTriggerSecret'>>;
12110
13657
  /** `POST /v1/triggers/{id}/test` — manual fire through the full pipeline; returns the decision + reason. */
12111
- test(id: string, body?: TriggerTestRequest, opts?: CallOpts$1): Promise<TriggerTestResult>;
13658
+ test(id: string, body?: TriggerTestRequest, opts?: CallOpts$3): Promise<TriggerTestResult>;
12112
13659
  /** `GET /v1/triggers/{id}/events?limit=` — recent deliveries with decisions. */
12113
- events(id: string, limit?: number, opts?: CallOpts$1): Promise<TriggerEvents>;
13660
+ events(id: string, limit?: number, opts?: CallOpts$3): Promise<TriggerEvents>;
12114
13661
  /**
12115
13662
  * `POST /v1/hooks/{id}` — send an event to a `generic` / `form` trigger from your own code. Signs the body
12116
13663
  * (`X-Codai-Signature: t=<unix>,v1=HMAC_SHA256(secret, "<t>.<body>")`, WebCrypto — Node 20+, browsers, Deno,
@@ -12125,7 +13672,7 @@ declare class Triggers {
12125
13672
  labels?: string[];
12126
13673
  dedupe_key?: string;
12127
13674
  resolved?: boolean;
12128
- }, opts?: CallOpts$1 & {
13675
+ }, opts?: CallOpts$3 & {
12129
13676
  deliveryId?: string;
12130
13677
  }): Promise<Reply<'receiveTriggerHook'>>;
12131
13678
  }
@@ -12136,18 +13683,52 @@ declare class Notifications {
12136
13683
  list(query?: {
12137
13684
  unread?: boolean;
12138
13685
  limit?: number;
12139
- }, opts?: CallOpts$1): Promise<NotificationList>;
13686
+ }, opts?: CallOpts$3): Promise<NotificationList>;
12140
13687
  /** `POST /v1/notifications/read` — `ids` omitted = every unread one. */
12141
- markRead(ids?: number[], opts?: CallOpts$1): Promise<NotificationsRead>;
13688
+ markRead(ids?: number[], opts?: CallOpts$3): Promise<NotificationsRead>;
12142
13689
  /** `DELETE /v1/notifications/:id` — `{ deleted: 0 }` when the id is missing or not yours. */
12143
- delete(id: number, opts?: CallOpts$1): Promise<NotificationsDeleted>;
13690
+ delete(id: number, opts?: CallOpts$3): Promise<NotificationsDeleted>;
12144
13691
  /** `POST /v1/notifications/delete` — 1..200 ids; ids of other users are skipped. */
12145
- deleteMany(ids: number[], opts?: CallOpts$1): Promise<NotificationsDeleted>;
13692
+ deleteMany(ids: number[], opts?: CallOpts$3): Promise<NotificationsDeleted>;
13693
+ }
13694
+
13695
+ /** `/v1/prompts/*` — pending prompts: ready-to-paste prompts left for a future chat (handoffs, follow-ups). */
13696
+
13697
+ type Prompt = Schema<'Prompt'>;
13698
+ type PromptStatus = Schema<'PromptStatus'>;
13699
+ type PromptSource = Schema<'PromptSource'>;
13700
+ type PromptList = Reply<'listPrompts'>;
13701
+ type PromptListQuery = Mutable<QueryOf<'listPrompts'>>;
13702
+ type PromptCreateRequest = Mutable<Body<'createPrompt'>>;
13703
+ type PromptCreated = Reply<'createPrompt'>;
13704
+ type PromptPatch = Mutable<Body<'updatePrompt'>>;
13705
+ type PromptLaunched = Reply<'launchPrompt'>;
13706
+ type PromptDeleted = Reply<'deletePrompt'>;
13707
+ type CallOpts$2 = {
13708
+ ext?: CodaiRequestExtensions;
13709
+ signal?: AbortSignal;
13710
+ };
13711
+ declare class Prompts {
13712
+ private readonly http;
13713
+ constructor(http: HttpClient);
13714
+ /** `GET /v1/prompts?status=&limit=` — default `open`; `due` = open and `not_before` empty or passed. */
13715
+ list(query?: PromptListQuery, opts?: CallOpts$2): Promise<PromptList>;
13716
+ /** `POST /v1/prompts` — idempotent on the text (`created: false` for a duplicate); `goal_key` supersedes older open ones. */
13717
+ create(body: PromptCreateRequest, opts?: CallOpts$2): Promise<PromptCreated>;
13718
+ /** `GET /v1/prompts/{id}`. */
13719
+ get(id: string, opts?: CallOpts$2): Promise<Prompt>;
13720
+ /** `PATCH /v1/prompts/{id}` — edit, snooze (`not_before`), close (`status: 'done' | 'dismissed'`). */
13721
+ update(id: string, body: PromptPatch, opts?: CallOpts$2): Promise<Prompt>;
13722
+ /** `DELETE /v1/prompts/{id}` — `{ deleted: 0 }` when the id is missing or not yours. */
13723
+ delete(id: string, opts?: CallOpts$2): Promise<PromptDeleted>;
13724
+ /** `POST /v1/prompts/{id}/launch` — new shared session + `send` control on a device; the prompt becomes `launched`. */
13725
+ launch(id: string, deviceId?: string, opts?: CallOpts$2): Promise<PromptLaunched>;
12146
13726
  }
12147
13727
 
12148
13728
  /** `POST /v1/tokens` — ephemeral scoped tokens for browsers / webviews. */
12149
13729
 
12150
- type EphemeralScope = 'realtime' | 'audio' | 'embeddings';
13730
+ /** `live` = realtime + audio in one token (a live co-host's speech-to-text and text-to-speech). */
13731
+ type EphemeralScope = 'realtime' | 'audio' | 'embeddings' | 'live';
12151
13732
  type EphemeralTokenResponse = Reply<'createEphemeralToken'>;
12152
13733
  interface EphemeralToken {
12153
13734
  token: string;
@@ -12174,7 +13755,7 @@ type ToolSearchRequest = Mutable<Body<'toolsSearch'>>;
12174
13755
  type ToolSearchResponse = Reply<'toolsSearch'>;
12175
13756
  type ToolFetchRequest = Mutable<Body<'toolsFetch'>>;
12176
13757
  type ToolFetchResponse = Reply<'toolsFetch'>;
12177
- type CallOpts = {
13758
+ type CallOpts$1 = {
12178
13759
  ext?: CodaiRequestExtensions;
12179
13760
  signal?: AbortSignal;
12180
13761
  };
@@ -12182,9 +13763,30 @@ declare class Tools {
12182
13763
  private readonly http;
12183
13764
  constructor(http: HttpClient);
12184
13765
  /** `POST /v1/tools/search` — verified web search (never falls back to an unverified provider). */
12185
- search(body: ToolSearchRequest, opts?: CallOpts): Promise<ToolSearchResponse>;
13766
+ search(body: ToolSearchRequest, opts?: CallOpts$1): Promise<ToolSearchResponse>;
12186
13767
  /** `POST /v1/tools/fetch` — fetch + extract a public page (SSRF-guarded). */
12187
- fetch(body: ToolFetchRequest, opts?: CallOpts): Promise<ToolFetchResponse>;
13768
+ fetch(body: ToolFetchRequest, opts?: CallOpts$1): Promise<ToolFetchResponse>;
13769
+ }
13770
+
13771
+ /**
13772
+ * `/v1/verify/agent-output*` — EXPERIMENTAL, unaudited (HIDE protocol) verification of
13773
+ * signed agent outputs. Provenance only, never authentication. Unauthenticated endpoints.
13774
+ */
13775
+
13776
+ type EnvironmentTaskOutputSignature = Schema<'EnvironmentTaskOutputSignature'>;
13777
+ type AgentOutputKey = Reply<'getAgentOutputKey'>;
13778
+ type AgentOutputVerifyBody = Mutable<Body<'verifyAgentOutput'>>;
13779
+ type AgentOutputVerifyResult = Reply<'verifyAgentOutput'>;
13780
+ type CallOpts = {
13781
+ signal?: AbortSignal;
13782
+ };
13783
+ declare class Verify {
13784
+ private readonly http;
13785
+ constructor(http: HttpClient);
13786
+ /** `GET /v1/verify/agent-output/key` — `{ enabled: false }` when signing is off. */
13787
+ agentOutputKey(opts?: CallOpts): Promise<AgentOutputKey>;
13788
+ /** `POST /v1/verify/agent-output` — 503 `signing_disabled` when signing is off. */
13789
+ agentOutput(body: AgentOutputVerifyBody, opts?: CallOpts): Promise<AgentOutputVerifyResult>;
12188
13790
  }
12189
13791
 
12190
13792
  /**
@@ -12211,12 +13813,14 @@ declare const RESOLVE_OPERATION_METHODS: Record<string, string>;
12211
13813
  * method — see `OPERATION_METHODS`). Resources hang off the `Codai` client:
12212
13814
  *
12213
13815
  * client.chat.completions.create / .stream client.messages / client.responses
12214
- * client.embeddings / client.audio / client.tokens / client.models / client.health
12215
- * client.systemOne.create (typed decisions, codai-s1)
13816
+ * client.embeddings / client.images / client.audio / client.tokens / client.models / client.health
13817
+ * client.systemOne.create / .batch (typed decisions, codai-s1)
13818
+ * client.realtime.connect (WebSocket live STT / voice; not an OpenAPI operation)
12216
13819
  * client.agents.run + client.agents.runs.* client.tools.search / .fetch
12217
13820
  * client.tasks.* client.sessions.* (events, controls, lease, shares, stream)
12218
13821
  * client.devices.* / client.hosts.* client.orgs.* / client.account / client.receipt
12219
13822
  * client.projects.* client.environments.* (members, ports, secrets)
13823
+ * client.verify.agentOutputKey / .agentOutput (EXPERIMENTAL HIDE-signed agent outputs)
12220
13824
  * client.feedback / client.phoneModels
12221
13825
  * client.resolve.* (verified bug fixes on https://resolve.codai.ro — resolve.yaml)
12222
13826
  *
@@ -12287,10 +13891,14 @@ declare class Codai {
12287
13891
  embeddings: number[][];
12288
13892
  raw: unknown;
12289
13893
  }>);
13894
+ /** Image generation and editing (`images.generate({ prompt })`, `images.edit({ prompt, image })`; codai-image = gemini-3.1-flash-image, EU). */
13895
+ readonly images: Images;
12290
13896
  readonly audio: Audio;
12291
13897
  /** Typed decisions from codai-s1 (`systemOne.create({ state, questions })`). */
12292
13898
  readonly systemOne: SystemOne;
12293
13899
  readonly tokens: Tokens;
13900
+ /** WebSocket realtime sessions (`realtime.connect({ model, language, token })`) — live STT and voice. */
13901
+ readonly realtime: Realtime;
12294
13902
  readonly models: Models & (() => Promise<Array<{
12295
13903
  id: string;
12296
13904
  }>>);
@@ -12302,12 +13910,16 @@ declare class Codai {
12302
13910
  readonly triggers: Triggers;
12303
13911
  /** Inbox of trigger / cloud-task notifications. */
12304
13912
  readonly notifications: Notifications;
13913
+ /** Pending prompts — ready-to-paste prompts left for a future chat (handoffs, dated follow-ups). */
13914
+ readonly prompts: Prompts;
12305
13915
  readonly sessions: Sessions;
12306
13916
  readonly devices: Devices;
12307
13917
  readonly hosts: Hosts;
12308
13918
  readonly orgs: Orgs;
12309
13919
  readonly projects: Projects;
12310
13920
  readonly environments: Environments;
13921
+ /** EXPERIMENTAL (HIDE, unaudited): verify signed agent outputs. Provenance only. */
13922
+ readonly verify: Verify;
12311
13923
  readonly account: Account;
12312
13924
  readonly receipt: Receipts;
12313
13925
  readonly feedback: Feedback & ((requestId: string, rating: 1 | -1, comment?: string) => Promise<void>);
@@ -12323,4 +13935,4 @@ declare class Codai {
12323
13935
  private legacyExt;
12324
13936
  }
12325
13937
 
12326
- export { Account, type AccountPatchRequest, type AccountPatchResponse, type AccountView, type AgentRun, type AgentRunAccepted, type AgentRunCreateRequest, type AgentRunRequest, type AgentRunResult, type AgentRunStats, type AgentRunStatus, type AgentRunStep, type AgentRunStreamEvent, AgentRuns, type AgentSyncResult, Agents, Audio, Chat, type ChatCallOptions, type ChatCompletionChunk, type ChatCompletionInput, type ChatCompletionRequest, type ChatCompletionResponse, ChatCompletions, type ChatMessage, type ChatOptions, type ChatResult, type ChatStream, type ChatStreamResult, type ChatTool, type ChatToolCall, type ChatUsage, Codai, type CodaiClientOptions, CodaiError, type CodaiRequestExtensions, type Device, type DevicePatch, type DevicePatched, Devices, type DispatchInbox, Embeddings, type EmbeddingsOptions, type EmbeddingsRequest, type EmbeddingsResponse, type EmbeddingsResult, type Environment, type EnvironmentAddMemberBody, type EnvironmentCreateBody, type EnvironmentDetail, type EnvironmentEnrollBody, type EnvironmentEnrollToken, type EnvironmentEnrolled, type EnvironmentMember, type EnvironmentMemberCreated, EnvironmentMembers, type EnvironmentPatchBody, type EnvironmentPort, type EnvironmentPortBody, EnvironmentPorts, type EnvironmentProvider, type EnvironmentRole, type EnvironmentSecret, type EnvironmentSecretSet, EnvironmentSecrets, type EnvironmentSshCa, type EnvironmentSshCert, type EnvironmentSshCertBody, type EnvironmentState, type EnvironmentTaskCreateBody, type EnvironmentTaskCreated, type EnvironmentTaskDetail, type EnvironmentTaskList, EnvironmentTasks, type EnvironmentTransition, Environments, type EphemeralScope, type EphemeralToken, type EphemeralTokenResponse, type ErrorCode, Feedback, type FeedbackRequest, type FeedbackResponse, Health, type HealthReadyResponse, type HealthResponse, type HostExecBody, type HostExecRequest, type HostExecResponse, type HostExecResultBody, type HostOp, type HostPresence, type HostStreamEvent, Hosts, HttpClient, type ListEnvironmentsQuery, type MessageCallOptions, type MessageInput, type MessageRequest, type MessageResponse, type MessageResult, type MessageStream, type MessageStreamEvent, type MessageStreamResult, Messages, type Model, type ModelList, Models, type NotificationList, Notifications, type NotificationsDeleted, type NotificationsRead, OPERATION_METHODS, type Org, type OrgAddMemberBody, type OrgMember, OrgMembers, type OrgRole, Orgs, type PhoneModel, PhoneModels, type Project, type ProjectCreateBody, type ProjectDetail, type ProjectIsolation, type ProjectPatchBody, Projects, RESOLVE_ATTESTATION_PAYLOAD_TYPE, RESOLVE_OPERATION_METHODS, RESOLVE_TERMINAL_STATUSES, type Receipt, Receipts, type RequestOptions, Resolve, type ResolveAccepted, type ResolveAttestation, type ResolveAttestationEnvelope, type ResolveAttestationVerifyResult, type components as ResolveComponents, type ResolveDeclined, ResolveError, type ResolveHealth, type ResolveInsufficientFunds, ResolveInsufficientFundsError, type ResolveIntake, type ResolveJob, type ResolveJobStatus, type ResolveKey, type ResolveKeys, type operations as ResolveOperations, type paths as ResolvePaths, type ResolveQuote, type ResolveReproTest, type ResolveSubmitResult, type ResolveTier, type ResolveValidationDetails, type ResolveWaitOptions, type ResolveWebhookEvent, type ResolveWebhookEventName, type ResolveWebhookJob, Responses, type ResponsesCallOptions, type ResponsesInput, type ResponsesRequest, type ResponsesResponse, type ResponsesResult, type ResponsesStream, type ResponsesStreamEvent, type ResponsesStreamResult, STREAMING_OPERATIONS, type Session, type SessionControl, type SessionControlAccepted, type SessionControlRequest, SessionControls, type SessionCreateRequest, type SessionDetail, type SessionDispatchRequest, type SessionDispatchResponse, type SessionEvent, SessionEvents, type SessionEventsAppendRequest, type SessionEventsAppendResponse, type SessionEventsPage, type SessionIncomingEvent, SessionLease, type SessionLeaseClaimRequest, type SessionLeaseResponse, type SessionListItem, type SessionPatchRequest, type SessionShare, type SessionShareCreateRequest, type SessionShareCreated, SessionShares, type SessionStreamEvent, Sessions, type SharedSession, type SpeechRequest, type SpeechResult, type SseFrame, type StatusResponse, type Task, type TaskConfirmRequest, type TaskConfirmResponse, type TaskListPage, type TaskListQuery, type TaskOutcome, type TaskStats, Tasks, type TokenUsage, Tokens, type ToolFetchRequest, type ToolFetchResponse, type ToolSearchRequest, type ToolSearchResponse, Tools, type TranscriptionOptions, type TranscriptionResponse, type TranscriptionResult, type TriggerCreateRequest, type TriggerCreated, type TriggerEvents, type TriggerList, type TriggerPatch, type TriggerTestRequest, type TriggerTestResult, type TriggerUpdated, Triggers, type VerifyResolveWebhookOptions, type components$1 as components, Codai as default, extensionHeaders, frameJson, mergeToolCall, type operations$1 as operations, type paths$1 as paths, readSse, resolveAttestationStatement, verifyAttestationWithKeys, verifyResolveWebhook };
13938
+ export { Account, type AccountPatchRequest, type AccountPatchResponse, type AccountView, type AgentOutputKey, type AgentOutputVerifyBody, type AgentOutputVerifyResult, type AgentRun, type AgentRunAccepted, type AgentRunCreateRequest, type AgentRunRequest, type AgentRunResult, type AgentRunStats, type AgentRunStatus, type AgentRunStep, type AgentRunStreamEvent, AgentRuns, type AgentSyncResult, Agents, Audio, Chat, type ChatCallOptions, type ChatCompletionChunk, type ChatCompletionInput, type ChatCompletionRequest, type ChatCompletionResponse, ChatCompletions, type ChatMessage, type ChatOptions, type ChatResult, type ChatStream, type ChatStreamResult, type ChatTool, type ChatToolCall, type ChatUsage, Codai, type CodaiClientOptions, CodaiError, type CodaiRequestExtensions, type Device, type DevicePatch, type DevicePatched, Devices, type DispatchInbox, Embeddings, type EmbeddingsOptions, type EmbeddingsRequest, type EmbeddingsResponse, type EmbeddingsResult, type Environment, type EnvironmentAddMemberBody, type EnvironmentCreateBody, type EnvironmentDetail, type EnvironmentEnrollBody, type EnvironmentEnrollToken, type EnvironmentEnrolled, type EnvironmentMember, type EnvironmentMemberCreated, EnvironmentMembers, type EnvironmentPatchBody, type EnvironmentPort, type EnvironmentPortBody, EnvironmentPorts, type EnvironmentProvider, type EnvironmentRole, type EnvironmentSecret, type EnvironmentSecretSet, EnvironmentSecrets, type EnvironmentSshCa, type EnvironmentSshCert, type EnvironmentSshCertBody, type EnvironmentState, type EnvironmentTaskCreateBody, type EnvironmentTaskCreated, type EnvironmentTaskDetail, type EnvironmentTaskList, type EnvironmentTaskOutputSignature, EnvironmentTasks, type EnvironmentTransition, Environments, type EphemeralScope, type EphemeralToken, type EphemeralTokenResponse, type ErrorCode, Feedback, type FeedbackRequest, type FeedbackResponse, Health, type HealthReadyResponse, type HealthResponse, type HostExecBody, type HostExecRequest, type HostExecResponse, type HostExecResultBody, type HostOp, type HostPresence, type HostStreamEvent, Hosts, HttpClient, type ImageEditRequest, Images, type ImagesRequest, type ImagesResponse, type ImagesResult, type ListEnvironmentsQuery, type MessageCallOptions, type MessageInput, type MessageRequest, type MessageResponse, type MessageResult, type MessageStream, type MessageStreamEvent, type MessageStreamResult, Messages, type Model, type ModelList, Models, type NotificationList, Notifications, type NotificationsDeleted, type NotificationsRead, OPERATION_METHODS, type Org, type OrgAddMemberBody, type OrgMember, OrgMembers, type OrgRole, Orgs, type PhoneModel, PhoneModels, type Project, type ProjectCreateBody, type ProjectDetail, type ProjectIsolation, type ProjectPatchBody, Projects, type Prompt, type PromptCreateRequest, type PromptCreated, type PromptDeleted, type PromptLaunched, type PromptList, type PromptListQuery, type PromptPatch, type PromptSource, type PromptStatus, Prompts, RESOLVE_ATTESTATION_PAYLOAD_TYPE, RESOLVE_OPERATION_METHODS, RESOLVE_TERMINAL_STATUSES, Realtime, type RealtimeAnyEvent, type RealtimeConnectOptions, type RealtimeEvent, type RealtimeModel, RealtimeSession, type RealtimeSocket, type RealtimeSocketCtor, type RealtimeUnknownEvent, type Receipt, Receipts, type RequestOptions, Resolve, type ResolveAccepted, type ResolveAttestation, type ResolveAttestationEnvelope, type ResolveAttestationVerifyResult, type ResolveBalance, type components as ResolveComponents, type ResolveDeclined, ResolveError, type ResolveHealth, type ResolveInsufficientFunds, ResolveInsufficientFundsError, type ResolveIntake, type ResolveJob, type ResolveJobStatus, type ResolveKey, type ResolveKeys, type operations as ResolveOperations, type ResolvePaidWith, type paths as ResolvePaths, type ResolveQuote, type ResolveReproTest, type ResolveSubmitResult, type ResolveTier, type ResolveValidationDetails, type ResolveWaitOptions, type ResolveWebhookEvent, type ResolveWebhookEventName, type ResolveWebhookJob, Responses, type ResponsesCallOptions, type ResponsesInput, type ResponsesRequest, type ResponsesResponse, type ResponsesResult, type ResponsesStream, type ResponsesStreamEvent, type ResponsesStreamResult, STREAMING_OPERATIONS, type Session, type SessionControl, type SessionControlAccepted, type SessionControlRequest, SessionControls, type SessionCreateRequest, type SessionDetail, type SessionDispatchMode, type SessionDispatchRequest, type SessionDispatchResponse, type SessionEvent, SessionEvents, type SessionEventsAppendRequest, type SessionEventsAppendResponse, type SessionEventsPage, type SessionIncomingEvent, SessionLease, type SessionLeaseClaimRequest, type SessionLeaseResponse, type SessionListItem, type SessionPatchRequest, type SessionShare, type SessionShareCreateRequest, type SessionShareCreated, SessionShares, type SessionStreamEvent, Sessions, type SharedSession, type SpeechRequest, type SpeechResult, type SpeechStreamEvent, type SpeechStreamEventSchema, type SpeechStreamRequest, type SseFrame, type StatusResponse, SystemOne, type SystemOneAnswers, type SystemOneBatchRequest, type SystemOneBatchResponse, type SystemOneRequest, type SystemOneResponse, type SystemOneSingleRequest, type SystemOneSingleResponse, type Task, type TaskConfirmRequest, type TaskConfirmResponse, type TaskListPage, type TaskListQuery, type TaskOutcome, type TaskStats, Tasks, type TokenUsage, Tokens, type ToolFetchRequest, type ToolFetchResponse, type ToolSearchRequest, type ToolSearchResponse, Tools, type TranscriptionOptions, type TranscriptionResponse, type TranscriptionResult, type TriggerCreateRequest, type TriggerCreated, type TriggerEvents, type TriggerList, type TriggerPatch, type TriggerTestRequest, type TriggerTestResult, type TriggerUpdated, Triggers, Verify, type VerifyResolveWebhookOptions, type components$1 as components, Codai as default, extensionHeaders, frameJson, mergeToolCall, type operations$1 as operations, type paths$1 as paths, readSse, realtimeUrl, resolveAttestationStatement, verifyAttestationWithKeys, verifyResolveWebhook };