@serviceai/api-spec 1.1.22 → 1.1.24

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/types.d.ts CHANGED
@@ -1278,6 +1278,552 @@ export interface paths {
1278
1278
  patch?: never;
1279
1279
  trace?: never;
1280
1280
  };
1281
+ "/api/chatty-voice/tools": {
1282
+ parameters: {
1283
+ query?: never;
1284
+ header?: never;
1285
+ path?: never;
1286
+ cookie?: never;
1287
+ };
1288
+ /**
1289
+ * List the OpenAI-Realtime-compatible function tools the executor can run.
1290
+ * @description Returns the canonical Chatty Voice tool catalogue as a BARE ARRAY of `ChattyToolDefinition` envelopes (no wrapping object). Each entry is executable via POST /api/chatty-voice/tools/execute.
1291
+ */
1292
+ get: {
1293
+ parameters: {
1294
+ query?: never;
1295
+ header?: {
1296
+ /** @description Semver of the calling app build. Drives the 426 / soft-upgrade handshake. */
1297
+ "X-Client-Version"?: string;
1298
+ };
1299
+ path?: never;
1300
+ cookie?: never;
1301
+ };
1302
+ requestBody?: never;
1303
+ responses: {
1304
+ /** @description Bare array of tool definitions. */
1305
+ 200: {
1306
+ headers: {
1307
+ [name: string]: unknown;
1308
+ };
1309
+ content: {
1310
+ "application/json": {
1311
+ /** @enum {string} */
1312
+ type: "function";
1313
+ function: {
1314
+ name: string;
1315
+ description: string;
1316
+ parameters: {
1317
+ /** @enum {string} */
1318
+ type: "object";
1319
+ properties: {
1320
+ [key: string]: {
1321
+ [key: string]: unknown;
1322
+ } & {
1323
+ type: string | string[];
1324
+ description?: string;
1325
+ enum?: string[];
1326
+ required?: string[];
1327
+ additionalProperties?: boolean;
1328
+ };
1329
+ };
1330
+ required?: string[];
1331
+ additionalProperties?: boolean;
1332
+ };
1333
+ };
1334
+ }[];
1335
+ };
1336
+ };
1337
+ /** @description Unauthenticated. */
1338
+ 401: {
1339
+ headers: {
1340
+ [name: string]: unknown;
1341
+ };
1342
+ content: {
1343
+ "application/json": components["schemas"]["ErrorEnvelope"];
1344
+ };
1345
+ };
1346
+ /** @description Caller lacks the chatty-voice entitlement. */
1347
+ 403: {
1348
+ headers: {
1349
+ [name: string]: unknown;
1350
+ };
1351
+ content: {
1352
+ "application/json": components["schemas"]["ErrorEnvelope"];
1353
+ };
1354
+ };
1355
+ /** @description Client major below minClientVersion. */
1356
+ 426: {
1357
+ headers: {
1358
+ [name: string]: unknown;
1359
+ };
1360
+ content: {
1361
+ "application/json": components["schemas"]["UpgradeRequiredEnvelope"];
1362
+ };
1363
+ };
1364
+ };
1365
+ };
1366
+ put?: never;
1367
+ post?: never;
1368
+ delete?: never;
1369
+ options?: never;
1370
+ head?: never;
1371
+ patch?: never;
1372
+ trace?: never;
1373
+ };
1374
+ "/api/chatty-voice/tools/execute": {
1375
+ parameters: {
1376
+ query?: never;
1377
+ header?: never;
1378
+ path?: never;
1379
+ cookie?: never;
1380
+ };
1381
+ get?: never;
1382
+ put?: never;
1383
+ /**
1384
+ * Execute a Chatty Voice tool by canonical `function` (or legacy `name`).
1385
+ * @description Body accepts either the canonical `function` field or the legacy `name` alias — at least one is required. The executor treats them as equivalent and dispatches to the same switch case in `tools.ts`. Tool arguments are passed through verbatim as an opaque JSON object.
1386
+ */
1387
+ post: {
1388
+ parameters: {
1389
+ query?: never;
1390
+ header?: {
1391
+ /** @description Semver of the calling app build. Drives the 426 / soft-upgrade handshake. */
1392
+ "X-Client-Version"?: string;
1393
+ };
1394
+ path?: never;
1395
+ cookie?: never;
1396
+ };
1397
+ requestBody?: {
1398
+ content: {
1399
+ "application/json": {
1400
+ function?: string;
1401
+ name?: string;
1402
+ arguments?: {
1403
+ [key: string]: unknown;
1404
+ };
1405
+ };
1406
+ };
1407
+ };
1408
+ responses: {
1409
+ /** @description Always returned when execution reaches the executor. `success: false` envelopes carry an `error` and (for permission denials) a `code` — including the missing/unknown function case. */
1410
+ 200: {
1411
+ headers: {
1412
+ [name: string]: unknown;
1413
+ };
1414
+ content: {
1415
+ "application/json": {
1416
+ success: boolean;
1417
+ message?: string;
1418
+ error?: string;
1419
+ code?: string;
1420
+ data?: unknown;
1421
+ action?: unknown;
1422
+ };
1423
+ };
1424
+ };
1425
+ /** @description Unauthenticated. */
1426
+ 401: {
1427
+ headers: {
1428
+ [name: string]: unknown;
1429
+ };
1430
+ content: {
1431
+ "application/json": components["schemas"]["ErrorEnvelope"];
1432
+ };
1433
+ };
1434
+ /** @description Caller lacks the chatty-voice entitlement or a per-tool permission. */
1435
+ 403: {
1436
+ headers: {
1437
+ [name: string]: unknown;
1438
+ };
1439
+ content: {
1440
+ "application/json": components["schemas"]["ErrorEnvelope"];
1441
+ };
1442
+ };
1443
+ /** @description Unhandled executor error. Body is `{ success: false, error }` (same envelope as 200). */
1444
+ 500: {
1445
+ headers: {
1446
+ [name: string]: unknown;
1447
+ };
1448
+ content: {
1449
+ "application/json": {
1450
+ success: boolean;
1451
+ message?: string;
1452
+ error?: string;
1453
+ code?: string;
1454
+ data?: unknown;
1455
+ action?: unknown;
1456
+ };
1457
+ };
1458
+ };
1459
+ };
1460
+ };
1461
+ delete?: never;
1462
+ options?: never;
1463
+ head?: never;
1464
+ patch?: never;
1465
+ trace?: never;
1466
+ };
1467
+ "/api/chatty-voice/ai-context": {
1468
+ parameters: {
1469
+ query?: never;
1470
+ header?: never;
1471
+ path?: never;
1472
+ cookie?: never;
1473
+ };
1474
+ /** Fetch the Chatty Voice system prompt + load-status flags. */
1475
+ get: {
1476
+ parameters: {
1477
+ query?: never;
1478
+ header?: {
1479
+ /** @description Semver of the calling app build. Drives the 426 / soft-upgrade handshake. */
1480
+ "X-Client-Version"?: string;
1481
+ };
1482
+ path?: never;
1483
+ cookie?: never;
1484
+ };
1485
+ requestBody?: never;
1486
+ responses: {
1487
+ /** @description System instructions + knowledge-base / workflow-stage load flags. */
1488
+ 200: {
1489
+ headers: {
1490
+ [name: string]: unknown;
1491
+ };
1492
+ content: {
1493
+ "application/json": {
1494
+ instructions: string;
1495
+ knowledgeBaseLoaded: boolean;
1496
+ workflowStagesLoaded: boolean;
1497
+ timestamp: string;
1498
+ };
1499
+ };
1500
+ };
1501
+ /** @description Unauthenticated. */
1502
+ 401: {
1503
+ headers: {
1504
+ [name: string]: unknown;
1505
+ };
1506
+ content: {
1507
+ "application/json": components["schemas"]["ErrorEnvelope"];
1508
+ };
1509
+ };
1510
+ /** @description Caller lacks the chatty-voice entitlement. */
1511
+ 403: {
1512
+ headers: {
1513
+ [name: string]: unknown;
1514
+ };
1515
+ content: {
1516
+ "application/json": components["schemas"]["ErrorEnvelope"];
1517
+ };
1518
+ };
1519
+ };
1520
+ };
1521
+ put?: never;
1522
+ post?: never;
1523
+ delete?: never;
1524
+ options?: never;
1525
+ head?: never;
1526
+ patch?: never;
1527
+ trace?: never;
1528
+ };
1529
+ "/api/realtime-token": {
1530
+ parameters: {
1531
+ query?: never;
1532
+ header?: never;
1533
+ path?: never;
1534
+ cookie?: never;
1535
+ };
1536
+ get?: never;
1537
+ put?: never;
1538
+ /**
1539
+ * Mint an OpenAI Realtime ephemeral session token (single union object).
1540
+ * @description Body: `{ directWebRTC?: boolean }`. Response is a SINGLE union object — the directWebRTC, desktop server-proxied, and HTTP-fallback branches all share the same envelope. Only `fallback` is always present; every other field is optional and presence depends on the branch.
1541
+ */
1542
+ post: {
1543
+ parameters: {
1544
+ query?: never;
1545
+ header?: {
1546
+ /** @description Semver of the calling app build. Drives the 426 / soft-upgrade handshake. */
1547
+ "X-Client-Version"?: string;
1548
+ };
1549
+ path?: never;
1550
+ cookie?: never;
1551
+ };
1552
+ requestBody?: {
1553
+ content: {
1554
+ "application/json": {
1555
+ directWebRTC?: boolean;
1556
+ };
1557
+ };
1558
+ };
1559
+ responses: {
1560
+ /** @description Session minted (or fallback signalled). See union shape. */
1561
+ 200: {
1562
+ headers: {
1563
+ [name: string]: unknown;
1564
+ };
1565
+ content: {
1566
+ "application/json": {
1567
+ sessionId?: string;
1568
+ model?: string;
1569
+ voice?: string;
1570
+ clientSecret?: string;
1571
+ fallback: boolean;
1572
+ directWebRTC?: boolean;
1573
+ useWebRTC?: boolean;
1574
+ expiresInSeconds?: number;
1575
+ metadata?: {
1576
+ organizationId: string | number;
1577
+ };
1578
+ message?: string;
1579
+ };
1580
+ };
1581
+ };
1582
+ /** @description Unauthenticated. */
1583
+ 401: {
1584
+ headers: {
1585
+ [name: string]: unknown;
1586
+ };
1587
+ content: {
1588
+ "application/json": components["schemas"]["ErrorEnvelope"];
1589
+ };
1590
+ };
1591
+ /** @description Caller lacks the chatty-voice entitlement. */
1592
+ 403: {
1593
+ headers: {
1594
+ [name: string]: unknown;
1595
+ };
1596
+ content: {
1597
+ "application/json": components["schemas"]["ErrorEnvelope"];
1598
+ };
1599
+ };
1600
+ /** @description Method Not Allowed (POST only). */
1601
+ 405: {
1602
+ headers: {
1603
+ [name: string]: unknown;
1604
+ };
1605
+ content: {
1606
+ "application/json": components["schemas"]["ErrorEnvelope"];
1607
+ };
1608
+ };
1609
+ /** @description Per-user rate limit on token mint. */
1610
+ 429: {
1611
+ headers: {
1612
+ [name: string]: unknown;
1613
+ };
1614
+ content: {
1615
+ "application/json": components["schemas"]["ErrorEnvelope"];
1616
+ };
1617
+ };
1618
+ /** @description Mint failure — body still carries `fallback: true`. */
1619
+ 500: {
1620
+ headers: {
1621
+ [name: string]: unknown;
1622
+ };
1623
+ content: {
1624
+ "application/json": {
1625
+ sessionId?: string;
1626
+ model?: string;
1627
+ voice?: string;
1628
+ clientSecret?: string;
1629
+ fallback: boolean;
1630
+ directWebRTC?: boolean;
1631
+ useWebRTC?: boolean;
1632
+ expiresInSeconds?: number;
1633
+ metadata?: {
1634
+ organizationId: string | number;
1635
+ };
1636
+ message?: string;
1637
+ };
1638
+ };
1639
+ };
1640
+ };
1641
+ };
1642
+ delete?: never;
1643
+ options?: never;
1644
+ head?: never;
1645
+ patch?: never;
1646
+ trace?: never;
1647
+ };
1648
+ "/api/csrf-token": {
1649
+ parameters: {
1650
+ query?: never;
1651
+ header?: never;
1652
+ path?: never;
1653
+ cookie?: never;
1654
+ };
1655
+ /**
1656
+ * Mint a short-lived CSRF token for the WebRTC SDP exchange.
1657
+ * @description Returned token is required as `X-CSRF-Token` on POST /api/realtime/webrtc and is bound to the calling user for 5 minutes.
1658
+ */
1659
+ get: {
1660
+ parameters: {
1661
+ query?: never;
1662
+ header?: {
1663
+ /** @description Semver of the calling app build. Drives the 426 / soft-upgrade handshake. */
1664
+ "X-Client-Version"?: string;
1665
+ };
1666
+ path?: never;
1667
+ cookie?: never;
1668
+ };
1669
+ requestBody?: never;
1670
+ responses: {
1671
+ /** @description Fresh CSRF token. */
1672
+ 200: {
1673
+ headers: {
1674
+ [name: string]: unknown;
1675
+ };
1676
+ content: {
1677
+ "application/json": {
1678
+ token: string;
1679
+ };
1680
+ };
1681
+ };
1682
+ /** @description Unauthenticated. */
1683
+ 401: {
1684
+ headers: {
1685
+ [name: string]: unknown;
1686
+ };
1687
+ content: {
1688
+ "application/json": components["schemas"]["ErrorEnvelope"];
1689
+ };
1690
+ };
1691
+ /** @description Caller lacks the chatty-voice entitlement. */
1692
+ 403: {
1693
+ headers: {
1694
+ [name: string]: unknown;
1695
+ };
1696
+ content: {
1697
+ "application/json": components["schemas"]["ErrorEnvelope"];
1698
+ };
1699
+ };
1700
+ };
1701
+ };
1702
+ put?: never;
1703
+ post?: never;
1704
+ delete?: never;
1705
+ options?: never;
1706
+ head?: never;
1707
+ patch?: never;
1708
+ trace?: never;
1709
+ };
1710
+ "/api/realtime/webrtc": {
1711
+ parameters: {
1712
+ query?: never;
1713
+ header?: never;
1714
+ path?: never;
1715
+ cookie?: never;
1716
+ };
1717
+ get?: never;
1718
+ put?: never;
1719
+ /**
1720
+ * Server-proxied OpenAI Realtime SDP exchange (desktop branch).
1721
+ * @description Request body is JSON `{ sdp }`; the server mints a fresh OpenAI ephemeral client_secret, forwards the raw SDP to OpenAI's WebRTC endpoint, and returns the raw SDP answer as `application/sdp` text. CSRF-protected via `X-CSRF-Token` (see GET /api/csrf-token) and rate-limited to 3 req/min/IP.
1722
+ */
1723
+ post: {
1724
+ parameters: {
1725
+ query?: never;
1726
+ header: {
1727
+ /** @description Semver of the calling app build. Drives the 426 / soft-upgrade handshake. */
1728
+ "X-Client-Version"?: string;
1729
+ /** @description CSRF token previously minted by GET /api/csrf-token. */
1730
+ "X-CSRF-Token": string;
1731
+ };
1732
+ path?: never;
1733
+ cookie?: never;
1734
+ };
1735
+ requestBody?: {
1736
+ content: {
1737
+ "application/json": {
1738
+ sdp: string;
1739
+ };
1740
+ };
1741
+ };
1742
+ responses: {
1743
+ /** @description Raw OpenAI SDP answer (text body, not JSON). */
1744
+ 200: {
1745
+ headers: {
1746
+ [name: string]: unknown;
1747
+ };
1748
+ content: {
1749
+ "application/sdp": string;
1750
+ };
1751
+ };
1752
+ /** @description Invalid SDP format. */
1753
+ 400: {
1754
+ headers: {
1755
+ [name: string]: unknown;
1756
+ };
1757
+ content: {
1758
+ "application/json": components["schemas"]["ErrorEnvelope"];
1759
+ };
1760
+ };
1761
+ /** @description Unauthenticated. */
1762
+ 401: {
1763
+ headers: {
1764
+ [name: string]: unknown;
1765
+ };
1766
+ content: {
1767
+ "application/json": components["schemas"]["ErrorEnvelope"];
1768
+ };
1769
+ };
1770
+ /** @description Caller lacks the chatty-voice entitlement, or CSRF token invalid. */
1771
+ 403: {
1772
+ headers: {
1773
+ [name: string]: unknown;
1774
+ };
1775
+ content: {
1776
+ "application/json": components["schemas"]["ErrorEnvelope"];
1777
+ };
1778
+ };
1779
+ /** @description Rate limit (3 req/min/IP). */
1780
+ 429: {
1781
+ headers: {
1782
+ [name: string]: unknown;
1783
+ };
1784
+ content: {
1785
+ "application/json": components["schemas"]["ErrorEnvelope"];
1786
+ };
1787
+ };
1788
+ /** @description SDP exchange failed locally. */
1789
+ 500: {
1790
+ headers: {
1791
+ [name: string]: unknown;
1792
+ };
1793
+ content: {
1794
+ "application/json": components["schemas"]["ErrorEnvelope"];
1795
+ };
1796
+ };
1797
+ /** @description Local failure minting the OpenAI ephemeral client_secret required to authenticate the SDP exchange. Returned as a JSON envelope generated by this server: `{ error, status? }`. */
1798
+ 502: {
1799
+ headers: {
1800
+ [name: string]: unknown;
1801
+ };
1802
+ content: {
1803
+ "application/json": {
1804
+ error: string;
1805
+ status?: number;
1806
+ };
1807
+ };
1808
+ };
1809
+ /** @description Upstream OpenAI SDP exchange error. Pass-through: this endpoint forwards OpenAI's HTTP status verbatim (typically 4xx/5xx) and the body is OpenAI's raw error payload — NOT a JSON envelope generated by this server. Content-Type and exact shape are determined by OpenAI; clients MUST treat any non-200 response on this endpoint as opaque error text unless they explicitly detect the 502 JSON envelope above. */
1810
+ default: {
1811
+ headers: {
1812
+ [name: string]: unknown;
1813
+ };
1814
+ content: {
1815
+ "application/json": unknown;
1816
+ "text/plain": string;
1817
+ };
1818
+ };
1819
+ };
1820
+ };
1821
+ delete?: never;
1822
+ options?: never;
1823
+ head?: never;
1824
+ patch?: never;
1825
+ trace?: never;
1826
+ };
1281
1827
  }
1282
1828
  export type webhooks = Record<string, never>;
1283
1829
  export interface components {
@@ -1302,7 +1848,7 @@ export interface components {
1302
1848
  };
1303
1849
  /** @description Cross-platform version handshake manifest. See docs/api-versioning.md. */
1304
1850
  VersionManifest: {
1305
- /** @example 1.1.22 */
1851
+ /** @example 1.1.24 */
1306
1852
  apiVersion: string;
1307
1853
  /** @example 1.0.0 */
1308
1854
  minClientVersion: string;
@@ -1762,6 +2308,75 @@ export interface components {
1762
2308
  squareUpAngleRad: number;
1763
2309
  mirrorX: boolean;
1764
2310
  };
2311
+ ChattyToolDefinition: {
2312
+ /** @enum {string} */
2313
+ type: "function";
2314
+ function: {
2315
+ name: string;
2316
+ description: string;
2317
+ parameters: {
2318
+ /** @enum {string} */
2319
+ type: "object";
2320
+ properties: {
2321
+ [key: string]: {
2322
+ [key: string]: unknown;
2323
+ } & {
2324
+ type: string | string[];
2325
+ description?: string;
2326
+ enum?: string[];
2327
+ required?: string[];
2328
+ additionalProperties?: boolean;
2329
+ };
2330
+ };
2331
+ required?: string[];
2332
+ additionalProperties?: boolean;
2333
+ };
2334
+ };
2335
+ };
2336
+ ChattyExecuteRequest: {
2337
+ function?: string;
2338
+ name?: string;
2339
+ arguments?: {
2340
+ [key: string]: unknown;
2341
+ };
2342
+ };
2343
+ ChattyExecuteResponse: {
2344
+ success: boolean;
2345
+ message?: string;
2346
+ error?: string;
2347
+ code?: string;
2348
+ data?: unknown;
2349
+ action?: unknown;
2350
+ };
2351
+ ChattyAiContextResponse: {
2352
+ instructions: string;
2353
+ knowledgeBaseLoaded: boolean;
2354
+ workflowStagesLoaded: boolean;
2355
+ timestamp: string;
2356
+ };
2357
+ RealtimeTokenRequest: {
2358
+ directWebRTC?: boolean;
2359
+ };
2360
+ RealtimeTokenResponse: {
2361
+ sessionId?: string;
2362
+ model?: string;
2363
+ voice?: string;
2364
+ clientSecret?: string;
2365
+ fallback: boolean;
2366
+ directWebRTC?: boolean;
2367
+ useWebRTC?: boolean;
2368
+ expiresInSeconds?: number;
2369
+ metadata?: {
2370
+ organizationId: string | number;
2371
+ };
2372
+ message?: string;
2373
+ };
2374
+ CsrfTokenResponse: {
2375
+ token: string;
2376
+ };
2377
+ RealtimeWebrtcRequest: {
2378
+ sdp: string;
2379
+ };
1765
2380
  };
1766
2381
  responses: never;
1767
2382
  parameters: never;