@genesislcap/foundation-ai 15.40.0 → 15.42.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/README.md +21 -0
- package/dist/dts/index.d.ts +2 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/transports/ai-service-error.d.ts +146 -0
- package/dist/dts/transports/ai-service-error.d.ts.map +1 -0
- package/dist/dts/transports/post-with-retry.d.ts.map +1 -1
- package/dist/dts/types/chat.types.d.ts +72 -11
- package/dist/dts/types/chat.types.d.ts.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/transports/ai-service-error.js +183 -0
- package/dist/esm/transports/post-with-retry.js +43 -5
- package/dist/foundation-ai.api.json +756 -37
- package/dist/foundation-ai.d.ts +198 -11
- package/package.json +10 -10
|
@@ -378,6 +378,62 @@
|
|
|
378
378
|
"endIndex": 0
|
|
379
379
|
}
|
|
380
380
|
},
|
|
381
|
+
{
|
|
382
|
+
"kind": "Variable",
|
|
383
|
+
"canonicalReference": "@genesislcap/foundation-ai!AI_SERVICE_ACCESS_REFUSALS:var",
|
|
384
|
+
"docComment": "/**\n * Refusals that come from the app's gateway, not from its AI service. The Genesis router turns a request away before the service runs: with no session (401) or without the right the endpoint demands (403). Its body is the router's own NACK, with no `code` a proxy would send, so these are kept out of {@link AI_SERVICE_ERROR_CODES}.\n *\n * @beta\n */\n",
|
|
385
|
+
"excerptTokens": [
|
|
386
|
+
{
|
|
387
|
+
"kind": "Content",
|
|
388
|
+
"text": "AI_SERVICE_ACCESS_REFUSALS: "
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"kind": "Reference",
|
|
392
|
+
"text": "Readonly",
|
|
393
|
+
"canonicalReference": "!Readonly:type"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"kind": "Content",
|
|
397
|
+
"text": "<{\n readonly SIGNED_OUT: \"SIGNED_OUT\";\n readonly ACCESS_DENIED: \"ACCESS_DENIED\";\n}>"
|
|
398
|
+
}
|
|
399
|
+
],
|
|
400
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
401
|
+
"isReadonly": true,
|
|
402
|
+
"releaseTag": "Beta",
|
|
403
|
+
"name": "AI_SERVICE_ACCESS_REFUSALS",
|
|
404
|
+
"variableTypeTokenRange": {
|
|
405
|
+
"startIndex": 1,
|
|
406
|
+
"endIndex": 3
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"kind": "Variable",
|
|
411
|
+
"canonicalReference": "@genesislcap/foundation-ai!AI_SERVICE_ERROR_CODES:var",
|
|
412
|
+
"docComment": "/**\n * Every code an AI service may put in an error body. A code not listed here keeps the old, status-based handling: an unknown code must not become a silent dead end, or a retry loop.\n *\n * @beta\n */\n",
|
|
413
|
+
"excerptTokens": [
|
|
414
|
+
{
|
|
415
|
+
"kind": "Content",
|
|
416
|
+
"text": "AI_SERVICE_ERROR_CODES: "
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"kind": "Reference",
|
|
420
|
+
"text": "Readonly",
|
|
421
|
+
"canonicalReference": "!Readonly:type"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"kind": "Content",
|
|
425
|
+
"text": "<{\n readonly NO_API_KEY: \"NO_API_KEY\";\n readonly BAD_API_KEY: \"BAD_API_KEY\";\n readonly KEY_UNREADABLE: \"KEY_UNREADABLE\";\n readonly MODEL_NOT_ALLOWED: \"MODEL_NOT_ALLOWED\";\n readonly BAD_REQUEST: \"BAD_REQUEST\";\n readonly FALLBACKS_NOT_SUPPORTED: \"FALLBACKS_NOT_SUPPORTED\";\n readonly REQUEST_TOO_LARGE: \"REQUEST_TOO_LARGE\";\n readonly VENDOR_UNREACHABLE: \"VENDOR_UNREACHABLE\";\n}>"
|
|
426
|
+
}
|
|
427
|
+
],
|
|
428
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
429
|
+
"isReadonly": true,
|
|
430
|
+
"releaseTag": "Beta",
|
|
431
|
+
"name": "AI_SERVICE_ERROR_CODES",
|
|
432
|
+
"variableTypeTokenRange": {
|
|
433
|
+
"startIndex": 1,
|
|
434
|
+
"endIndex": 3
|
|
435
|
+
}
|
|
436
|
+
},
|
|
381
437
|
{
|
|
382
438
|
"kind": "Variable",
|
|
383
439
|
"canonicalReference": "@genesislcap/foundation-ai!AI_TIER_IDS:var",
|
|
@@ -1246,91 +1302,611 @@
|
|
|
1246
1302
|
}
|
|
1247
1303
|
},
|
|
1248
1304
|
{
|
|
1249
|
-
"kind": "PropertySignature",
|
|
1250
|
-
"canonicalReference": "@genesislcap/foundation-ai!AIProviderRegistryStatusEntry#name:member",
|
|
1251
|
-
"docComment": "/**\n * The name the provider was registered under.\n */\n",
|
|
1305
|
+
"kind": "PropertySignature",
|
|
1306
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIProviderRegistryStatusEntry#name:member",
|
|
1307
|
+
"docComment": "/**\n * The name the provider was registered under.\n */\n",
|
|
1308
|
+
"excerptTokens": [
|
|
1309
|
+
{
|
|
1310
|
+
"kind": "Content",
|
|
1311
|
+
"text": "name: "
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
"kind": "Content",
|
|
1315
|
+
"text": "string"
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"kind": "Content",
|
|
1319
|
+
"text": ";"
|
|
1320
|
+
}
|
|
1321
|
+
],
|
|
1322
|
+
"isReadonly": false,
|
|
1323
|
+
"isOptional": false,
|
|
1324
|
+
"releaseTag": "Beta",
|
|
1325
|
+
"name": "name",
|
|
1326
|
+
"propertyTypeTokenRange": {
|
|
1327
|
+
"startIndex": 1,
|
|
1328
|
+
"endIndex": 2
|
|
1329
|
+
}
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"kind": "PropertySignature",
|
|
1333
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIProviderRegistryStatusEntry#status:member",
|
|
1334
|
+
"docComment": "/**\n * The provider's `getStatus()` result, or `null` if unavailable.\n */\n",
|
|
1335
|
+
"excerptTokens": [
|
|
1336
|
+
{
|
|
1337
|
+
"kind": "Content",
|
|
1338
|
+
"text": "status: "
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
"kind": "Reference",
|
|
1342
|
+
"text": "AIStatus",
|
|
1343
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIStatus:interface"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
"kind": "Content",
|
|
1347
|
+
"text": " | null"
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
"kind": "Content",
|
|
1351
|
+
"text": ";"
|
|
1352
|
+
}
|
|
1353
|
+
],
|
|
1354
|
+
"isReadonly": false,
|
|
1355
|
+
"isOptional": false,
|
|
1356
|
+
"releaseTag": "Beta",
|
|
1357
|
+
"name": "status",
|
|
1358
|
+
"propertyTypeTokenRange": {
|
|
1359
|
+
"startIndex": 1,
|
|
1360
|
+
"endIndex": 3
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
],
|
|
1364
|
+
"extendsTokenRanges": []
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
"kind": "TypeAlias",
|
|
1368
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIProviderType:type",
|
|
1369
|
+
"docComment": "/**\n * All AI provider identifiers (server, client, unconfigured).\n *\n * @beta\n */\n",
|
|
1370
|
+
"excerptTokens": [
|
|
1371
|
+
{
|
|
1372
|
+
"kind": "Content",
|
|
1373
|
+
"text": "export type AIProviderType = "
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
"kind": "Content",
|
|
1377
|
+
"text": "'openai' | 'chrome' | 'gemini' | 'anthropic' | 'none'"
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
"kind": "Content",
|
|
1381
|
+
"text": ";"
|
|
1382
|
+
}
|
|
1383
|
+
],
|
|
1384
|
+
"fileUrlPath": "src/types/config.types.ts",
|
|
1385
|
+
"releaseTag": "Beta",
|
|
1386
|
+
"name": "AIProviderType",
|
|
1387
|
+
"typeTokenRange": {
|
|
1388
|
+
"startIndex": 1,
|
|
1389
|
+
"endIndex": 2
|
|
1390
|
+
}
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
"kind": "TypeAlias",
|
|
1394
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceAccessRefusal:type",
|
|
1395
|
+
"docComment": "/**\n * One of {@link AI_SERVICE_ACCESS_REFUSALS}.\n *\n * @beta\n */\n",
|
|
1396
|
+
"excerptTokens": [
|
|
1397
|
+
{
|
|
1398
|
+
"kind": "Content",
|
|
1399
|
+
"text": "export type AIServiceAccessRefusal = "
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
"kind": "Content",
|
|
1403
|
+
"text": "(typeof "
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
"kind": "Reference",
|
|
1407
|
+
"text": "AI_SERVICE_ACCESS_REFUSALS",
|
|
1408
|
+
"canonicalReference": "@genesislcap/foundation-ai!AI_SERVICE_ACCESS_REFUSALS:var"
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
"kind": "Content",
|
|
1412
|
+
"text": ")[keyof typeof "
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
"kind": "Reference",
|
|
1416
|
+
"text": "AI_SERVICE_ACCESS_REFUSALS",
|
|
1417
|
+
"canonicalReference": "@genesislcap/foundation-ai!AI_SERVICE_ACCESS_REFUSALS:var"
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
"kind": "Content",
|
|
1421
|
+
"text": "]"
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
"kind": "Content",
|
|
1425
|
+
"text": ";"
|
|
1426
|
+
}
|
|
1427
|
+
],
|
|
1428
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
1429
|
+
"releaseTag": "Beta",
|
|
1430
|
+
"name": "AIServiceAccessRefusal",
|
|
1431
|
+
"typeTokenRange": {
|
|
1432
|
+
"startIndex": 1,
|
|
1433
|
+
"endIndex": 6
|
|
1434
|
+
}
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
"kind": "Function",
|
|
1438
|
+
"canonicalReference": "@genesislcap/foundation-ai!aiServiceAccessRefusalOf:function(1)",
|
|
1439
|
+
"docComment": "/**\n * The access refusal behind a 401 or 403 from the app's router, which carries no `code`.\n *\n * Recognised by a positive signal only, like the rest of this module's family: the router's NACK, or an empty body. A vendor's own 401/403, a coded one, and anything else (an HTML page from a proxy in between, say) keep their own handling.\n *\n * @param bodyText - the raw response body, so an empty one can be told from one that isn't JSON. Left out, the body is unknown rather than empty, and only the router's NACK counts.\n *\n * @beta\n */\n",
|
|
1440
|
+
"excerptTokens": [
|
|
1441
|
+
{
|
|
1442
|
+
"kind": "Content",
|
|
1443
|
+
"text": "export declare function aiServiceAccessRefusalOf(status: "
|
|
1444
|
+
},
|
|
1445
|
+
{
|
|
1446
|
+
"kind": "Content",
|
|
1447
|
+
"text": "number"
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
"kind": "Content",
|
|
1451
|
+
"text": ", payload: "
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
"kind": "Content",
|
|
1455
|
+
"text": "unknown"
|
|
1456
|
+
},
|
|
1457
|
+
{
|
|
1458
|
+
"kind": "Content",
|
|
1459
|
+
"text": ", bodyText?: "
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
"kind": "Content",
|
|
1463
|
+
"text": "string"
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
"kind": "Content",
|
|
1467
|
+
"text": "): "
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
"kind": "Reference",
|
|
1471
|
+
"text": "AIServiceAccessRefusal",
|
|
1472
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceAccessRefusal:type"
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
"kind": "Content",
|
|
1476
|
+
"text": " | undefined"
|
|
1477
|
+
},
|
|
1478
|
+
{
|
|
1479
|
+
"kind": "Content",
|
|
1480
|
+
"text": ";"
|
|
1481
|
+
}
|
|
1482
|
+
],
|
|
1483
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
1484
|
+
"returnTypeTokenRange": {
|
|
1485
|
+
"startIndex": 7,
|
|
1486
|
+
"endIndex": 9
|
|
1487
|
+
},
|
|
1488
|
+
"releaseTag": "Beta",
|
|
1489
|
+
"overloadIndex": 1,
|
|
1490
|
+
"parameters": [
|
|
1491
|
+
{
|
|
1492
|
+
"parameterName": "status",
|
|
1493
|
+
"parameterTypeTokenRange": {
|
|
1494
|
+
"startIndex": 1,
|
|
1495
|
+
"endIndex": 2
|
|
1496
|
+
},
|
|
1497
|
+
"isOptional": false
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
"parameterName": "payload",
|
|
1501
|
+
"parameterTypeTokenRange": {
|
|
1502
|
+
"startIndex": 3,
|
|
1503
|
+
"endIndex": 4
|
|
1504
|
+
},
|
|
1505
|
+
"isOptional": false
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
"parameterName": "bodyText",
|
|
1509
|
+
"parameterTypeTokenRange": {
|
|
1510
|
+
"startIndex": 5,
|
|
1511
|
+
"endIndex": 6
|
|
1512
|
+
},
|
|
1513
|
+
"isOptional": true
|
|
1514
|
+
}
|
|
1515
|
+
],
|
|
1516
|
+
"name": "aiServiceAccessRefusalOf"
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"kind": "Class",
|
|
1520
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceError:class",
|
|
1521
|
+
"docComment": "/**\n * Thrown when the AI service answers with one of {@link AI_SERVICE_ERROR_CODES}, or the app's router refuses the request with one of {@link AI_SERVICE_ACCESS_REFUSALS}.\n *\n * All but `VENDOR_UNREACHABLE` are terminal: sending the same request again gets the same answer until someone changes the configuration, or the user's session or rights.\n *\n * @beta\n */\n",
|
|
1522
|
+
"excerptTokens": [
|
|
1523
|
+
{
|
|
1524
|
+
"kind": "Content",
|
|
1525
|
+
"text": "export declare class AIServiceError extends "
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
"kind": "Reference",
|
|
1529
|
+
"text": "Error",
|
|
1530
|
+
"canonicalReference": "!Error:interface"
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
"kind": "Content",
|
|
1534
|
+
"text": " "
|
|
1535
|
+
}
|
|
1536
|
+
],
|
|
1537
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
1538
|
+
"releaseTag": "Beta",
|
|
1539
|
+
"isAbstract": false,
|
|
1540
|
+
"name": "AIServiceError",
|
|
1541
|
+
"preserveMemberOrder": false,
|
|
1542
|
+
"members": [
|
|
1543
|
+
{
|
|
1544
|
+
"kind": "Constructor",
|
|
1545
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceError:constructor(1)",
|
|
1546
|
+
"docComment": "/**\n * Constructs a new instance of the `AIServiceError` class\n */\n",
|
|
1547
|
+
"excerptTokens": [
|
|
1548
|
+
{
|
|
1549
|
+
"kind": "Content",
|
|
1550
|
+
"text": "constructor(\n vendorLabel: "
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
"kind": "Content",
|
|
1554
|
+
"text": "string"
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
"kind": "Content",
|
|
1558
|
+
"text": ", code: "
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
"kind": "Reference",
|
|
1562
|
+
"text": "AIServiceRefusal",
|
|
1563
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceRefusal:type"
|
|
1564
|
+
},
|
|
1565
|
+
{
|
|
1566
|
+
"kind": "Content",
|
|
1567
|
+
"text": ", \n status: "
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
"kind": "Content",
|
|
1571
|
+
"text": "number"
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
"kind": "Content",
|
|
1575
|
+
"text": ", \n detail?: "
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
"kind": "Content",
|
|
1579
|
+
"text": "string"
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
"kind": "Content",
|
|
1583
|
+
"text": ");"
|
|
1584
|
+
}
|
|
1585
|
+
],
|
|
1586
|
+
"releaseTag": "Beta",
|
|
1587
|
+
"isProtected": false,
|
|
1588
|
+
"overloadIndex": 1,
|
|
1589
|
+
"parameters": [
|
|
1590
|
+
{
|
|
1591
|
+
"parameterName": "vendorLabel",
|
|
1592
|
+
"parameterTypeTokenRange": {
|
|
1593
|
+
"startIndex": 1,
|
|
1594
|
+
"endIndex": 2
|
|
1595
|
+
},
|
|
1596
|
+
"isOptional": false
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
"parameterName": "code",
|
|
1600
|
+
"parameterTypeTokenRange": {
|
|
1601
|
+
"startIndex": 3,
|
|
1602
|
+
"endIndex": 4
|
|
1603
|
+
},
|
|
1604
|
+
"isOptional": false
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"parameterName": "status",
|
|
1608
|
+
"parameterTypeTokenRange": {
|
|
1609
|
+
"startIndex": 5,
|
|
1610
|
+
"endIndex": 6
|
|
1611
|
+
},
|
|
1612
|
+
"isOptional": false
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
"parameterName": "detail",
|
|
1616
|
+
"parameterTypeTokenRange": {
|
|
1617
|
+
"startIndex": 7,
|
|
1618
|
+
"endIndex": 8
|
|
1619
|
+
},
|
|
1620
|
+
"isOptional": true
|
|
1621
|
+
}
|
|
1622
|
+
]
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
"kind": "Property",
|
|
1626
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceError#code:member",
|
|
1627
|
+
"docComment": "",
|
|
1628
|
+
"excerptTokens": [
|
|
1629
|
+
{
|
|
1630
|
+
"kind": "Content",
|
|
1631
|
+
"text": "readonly code: "
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
"kind": "Reference",
|
|
1635
|
+
"text": "AIServiceRefusal",
|
|
1636
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceRefusal:type"
|
|
1637
|
+
},
|
|
1638
|
+
{
|
|
1639
|
+
"kind": "Content",
|
|
1640
|
+
"text": ";"
|
|
1641
|
+
}
|
|
1642
|
+
],
|
|
1643
|
+
"isReadonly": true,
|
|
1644
|
+
"isOptional": false,
|
|
1645
|
+
"releaseTag": "Beta",
|
|
1646
|
+
"name": "code",
|
|
1647
|
+
"propertyTypeTokenRange": {
|
|
1648
|
+
"startIndex": 1,
|
|
1649
|
+
"endIndex": 2
|
|
1650
|
+
},
|
|
1651
|
+
"isStatic": false,
|
|
1652
|
+
"isProtected": false,
|
|
1653
|
+
"isAbstract": false
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
"kind": "Property",
|
|
1657
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceError#detail:member",
|
|
1658
|
+
"docComment": "/**\n * The service's own message, for the console. Never shown to the user.\n */\n",
|
|
1659
|
+
"excerptTokens": [
|
|
1660
|
+
{
|
|
1661
|
+
"kind": "Content",
|
|
1662
|
+
"text": "readonly detail?: "
|
|
1663
|
+
},
|
|
1664
|
+
{
|
|
1665
|
+
"kind": "Content",
|
|
1666
|
+
"text": "string"
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
"kind": "Content",
|
|
1670
|
+
"text": ";"
|
|
1671
|
+
}
|
|
1672
|
+
],
|
|
1673
|
+
"isReadonly": true,
|
|
1674
|
+
"isOptional": true,
|
|
1675
|
+
"releaseTag": "Beta",
|
|
1676
|
+
"name": "detail",
|
|
1677
|
+
"propertyTypeTokenRange": {
|
|
1678
|
+
"startIndex": 1,
|
|
1679
|
+
"endIndex": 2
|
|
1680
|
+
},
|
|
1681
|
+
"isStatic": false,
|
|
1682
|
+
"isProtected": false,
|
|
1683
|
+
"isAbstract": false
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
"kind": "Property",
|
|
1687
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceError#status:member",
|
|
1688
|
+
"docComment": "/**\n * HTTP status, or the err frame's status on the framed path.\n */\n",
|
|
1689
|
+
"excerptTokens": [
|
|
1690
|
+
{
|
|
1691
|
+
"kind": "Content",
|
|
1692
|
+
"text": "readonly status: "
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
"kind": "Content",
|
|
1696
|
+
"text": "number"
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
"kind": "Content",
|
|
1700
|
+
"text": ";"
|
|
1701
|
+
}
|
|
1702
|
+
],
|
|
1703
|
+
"isReadonly": true,
|
|
1704
|
+
"isOptional": false,
|
|
1705
|
+
"releaseTag": "Beta",
|
|
1706
|
+
"name": "status",
|
|
1707
|
+
"propertyTypeTokenRange": {
|
|
1708
|
+
"startIndex": 1,
|
|
1709
|
+
"endIndex": 2
|
|
1710
|
+
},
|
|
1711
|
+
"isStatic": false,
|
|
1712
|
+
"isProtected": false,
|
|
1713
|
+
"isAbstract": false
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
"kind": "Property",
|
|
1717
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceError#terminal:member",
|
|
1718
|
+
"docComment": "/**\n * Whether sending the request again cannot help.\n */\n",
|
|
1252
1719
|
"excerptTokens": [
|
|
1253
1720
|
{
|
|
1254
1721
|
"kind": "Content",
|
|
1255
|
-
"text": "
|
|
1722
|
+
"text": "get terminal(): "
|
|
1256
1723
|
},
|
|
1257
1724
|
{
|
|
1258
1725
|
"kind": "Content",
|
|
1259
|
-
"text": "
|
|
1726
|
+
"text": "boolean"
|
|
1260
1727
|
},
|
|
1261
1728
|
{
|
|
1262
1729
|
"kind": "Content",
|
|
1263
1730
|
"text": ";"
|
|
1264
1731
|
}
|
|
1265
1732
|
],
|
|
1266
|
-
"isReadonly":
|
|
1733
|
+
"isReadonly": true,
|
|
1267
1734
|
"isOptional": false,
|
|
1268
1735
|
"releaseTag": "Beta",
|
|
1269
|
-
"name": "
|
|
1736
|
+
"name": "terminal",
|
|
1270
1737
|
"propertyTypeTokenRange": {
|
|
1271
1738
|
"startIndex": 1,
|
|
1272
1739
|
"endIndex": 2
|
|
1273
|
-
}
|
|
1740
|
+
},
|
|
1741
|
+
"isStatic": false,
|
|
1742
|
+
"isProtected": false,
|
|
1743
|
+
"isAbstract": false
|
|
1274
1744
|
},
|
|
1275
1745
|
{
|
|
1276
|
-
"kind": "
|
|
1277
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
1278
|
-
"docComment": "/**\n *
|
|
1746
|
+
"kind": "Property",
|
|
1747
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceError#vendorLabel:member",
|
|
1748
|
+
"docComment": "/**\n * Vendor label of the transport that was refused (e.g. `'Gemini'`).\n */\n",
|
|
1279
1749
|
"excerptTokens": [
|
|
1280
1750
|
{
|
|
1281
1751
|
"kind": "Content",
|
|
1282
|
-
"text": "
|
|
1283
|
-
},
|
|
1284
|
-
{
|
|
1285
|
-
"kind": "Reference",
|
|
1286
|
-
"text": "AIStatus",
|
|
1287
|
-
"canonicalReference": "@genesislcap/foundation-ai!AIStatus:interface"
|
|
1752
|
+
"text": "readonly vendorLabel: "
|
|
1288
1753
|
},
|
|
1289
1754
|
{
|
|
1290
1755
|
"kind": "Content",
|
|
1291
|
-
"text": "
|
|
1756
|
+
"text": "string"
|
|
1292
1757
|
},
|
|
1293
1758
|
{
|
|
1294
1759
|
"kind": "Content",
|
|
1295
1760
|
"text": ";"
|
|
1296
1761
|
}
|
|
1297
1762
|
],
|
|
1298
|
-
"isReadonly":
|
|
1763
|
+
"isReadonly": true,
|
|
1299
1764
|
"isOptional": false,
|
|
1300
1765
|
"releaseTag": "Beta",
|
|
1301
|
-
"name": "
|
|
1766
|
+
"name": "vendorLabel",
|
|
1302
1767
|
"propertyTypeTokenRange": {
|
|
1303
1768
|
"startIndex": 1,
|
|
1304
|
-
"endIndex":
|
|
1305
|
-
}
|
|
1769
|
+
"endIndex": 2
|
|
1770
|
+
},
|
|
1771
|
+
"isStatic": false,
|
|
1772
|
+
"isProtected": false,
|
|
1773
|
+
"isAbstract": false
|
|
1306
1774
|
}
|
|
1307
1775
|
],
|
|
1308
|
-
"
|
|
1776
|
+
"extendsTokenRange": {
|
|
1777
|
+
"startIndex": 1,
|
|
1778
|
+
"endIndex": 2
|
|
1779
|
+
},
|
|
1780
|
+
"implementsTokenRanges": []
|
|
1309
1781
|
},
|
|
1310
1782
|
{
|
|
1311
1783
|
"kind": "TypeAlias",
|
|
1312
|
-
"canonicalReference": "@genesislcap/foundation-ai!
|
|
1313
|
-
"docComment": "/**\n *
|
|
1784
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceErrorCode:type",
|
|
1785
|
+
"docComment": "/**\n * One of {@link AI_SERVICE_ERROR_CODES}.\n *\n * @beta\n */\n",
|
|
1314
1786
|
"excerptTokens": [
|
|
1315
1787
|
{
|
|
1316
1788
|
"kind": "Content",
|
|
1317
|
-
"text": "export type
|
|
1789
|
+
"text": "export type AIServiceErrorCode = "
|
|
1318
1790
|
},
|
|
1319
1791
|
{
|
|
1320
1792
|
"kind": "Content",
|
|
1321
|
-
"text": "
|
|
1793
|
+
"text": "(typeof "
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
"kind": "Reference",
|
|
1797
|
+
"text": "AI_SERVICE_ERROR_CODES",
|
|
1798
|
+
"canonicalReference": "@genesislcap/foundation-ai!AI_SERVICE_ERROR_CODES:var"
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
"kind": "Content",
|
|
1802
|
+
"text": ")[keyof typeof "
|
|
1803
|
+
},
|
|
1804
|
+
{
|
|
1805
|
+
"kind": "Reference",
|
|
1806
|
+
"text": "AI_SERVICE_ERROR_CODES",
|
|
1807
|
+
"canonicalReference": "@genesislcap/foundation-ai!AI_SERVICE_ERROR_CODES:var"
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
"kind": "Content",
|
|
1811
|
+
"text": "]"
|
|
1322
1812
|
},
|
|
1323
1813
|
{
|
|
1324
1814
|
"kind": "Content",
|
|
1325
1815
|
"text": ";"
|
|
1326
1816
|
}
|
|
1327
1817
|
],
|
|
1328
|
-
"fileUrlPath": "src/
|
|
1818
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
1329
1819
|
"releaseTag": "Beta",
|
|
1330
|
-
"name": "
|
|
1820
|
+
"name": "AIServiceErrorCode",
|
|
1331
1821
|
"typeTokenRange": {
|
|
1332
1822
|
"startIndex": 1,
|
|
1333
|
-
"endIndex":
|
|
1823
|
+
"endIndex": 6
|
|
1824
|
+
}
|
|
1825
|
+
},
|
|
1826
|
+
{
|
|
1827
|
+
"kind": "Function",
|
|
1828
|
+
"canonicalReference": "@genesislcap/foundation-ai!aiServiceErrorCodeOf:function(1)",
|
|
1829
|
+
"docComment": "/**\n * The code, when it is one of {@link AI_SERVICE_ERROR_CODES}; otherwise `undefined`.\n *\n * @beta\n */\n",
|
|
1830
|
+
"excerptTokens": [
|
|
1831
|
+
{
|
|
1832
|
+
"kind": "Content",
|
|
1833
|
+
"text": "export declare function aiServiceErrorCodeOf(code: "
|
|
1834
|
+
},
|
|
1835
|
+
{
|
|
1836
|
+
"kind": "Content",
|
|
1837
|
+
"text": "unknown"
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
"kind": "Content",
|
|
1841
|
+
"text": "): "
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
"kind": "Reference",
|
|
1845
|
+
"text": "AIServiceErrorCode",
|
|
1846
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceErrorCode:type"
|
|
1847
|
+
},
|
|
1848
|
+
{
|
|
1849
|
+
"kind": "Content",
|
|
1850
|
+
"text": " | undefined"
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
"kind": "Content",
|
|
1854
|
+
"text": ";"
|
|
1855
|
+
}
|
|
1856
|
+
],
|
|
1857
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
1858
|
+
"returnTypeTokenRange": {
|
|
1859
|
+
"startIndex": 3,
|
|
1860
|
+
"endIndex": 5
|
|
1861
|
+
},
|
|
1862
|
+
"releaseTag": "Beta",
|
|
1863
|
+
"overloadIndex": 1,
|
|
1864
|
+
"parameters": [
|
|
1865
|
+
{
|
|
1866
|
+
"parameterName": "code",
|
|
1867
|
+
"parameterTypeTokenRange": {
|
|
1868
|
+
"startIndex": 1,
|
|
1869
|
+
"endIndex": 2
|
|
1870
|
+
},
|
|
1871
|
+
"isOptional": false
|
|
1872
|
+
}
|
|
1873
|
+
],
|
|
1874
|
+
"name": "aiServiceErrorCodeOf"
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
"kind": "TypeAlias",
|
|
1878
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceRefusal:type",
|
|
1879
|
+
"docComment": "/**\n * Everything the chat can tell the user about a refused request: a code the service sent, or an access refusal from in front of it.\n *\n * @beta\n */\n",
|
|
1880
|
+
"excerptTokens": [
|
|
1881
|
+
{
|
|
1882
|
+
"kind": "Content",
|
|
1883
|
+
"text": "export type AIServiceRefusal = "
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
"kind": "Reference",
|
|
1887
|
+
"text": "AIServiceErrorCode",
|
|
1888
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceErrorCode:type"
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
"kind": "Content",
|
|
1892
|
+
"text": " | "
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
"kind": "Reference",
|
|
1896
|
+
"text": "AIServiceAccessRefusal",
|
|
1897
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceAccessRefusal:type"
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
"kind": "Content",
|
|
1901
|
+
"text": ";"
|
|
1902
|
+
}
|
|
1903
|
+
],
|
|
1904
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
1905
|
+
"releaseTag": "Beta",
|
|
1906
|
+
"name": "AIServiceRefusal",
|
|
1907
|
+
"typeTokenRange": {
|
|
1908
|
+
"startIndex": 1,
|
|
1909
|
+
"endIndex": 4
|
|
1334
1910
|
}
|
|
1335
1911
|
},
|
|
1336
1912
|
{
|
|
@@ -7527,7 +8103,16 @@
|
|
|
7527
8103
|
},
|
|
7528
8104
|
{
|
|
7529
8105
|
"kind": "Content",
|
|
7530
|
-
"text": "<{\n ok: true;\n result: T;\n reason?: never;\n } | {\n ok: false;\n result?: never;\n reason: "
|
|
8106
|
+
"text": "<{\n ok: true;\n result: T;\n reason?: never;\n code?: never;\n terminal?: never;\n } | {\n ok: false;\n result?: never;\n reason: "
|
|
8107
|
+
},
|
|
8108
|
+
{
|
|
8109
|
+
"kind": "Reference",
|
|
8110
|
+
"text": "Exclude",
|
|
8111
|
+
"canonicalReference": "!Exclude:type"
|
|
8112
|
+
},
|
|
8113
|
+
{
|
|
8114
|
+
"kind": "Content",
|
|
8115
|
+
"text": "<"
|
|
7531
8116
|
},
|
|
7532
8117
|
{
|
|
7533
8118
|
"kind": "Reference",
|
|
@@ -7536,7 +8121,16 @@
|
|
|
7536
8121
|
},
|
|
7537
8122
|
{
|
|
7538
8123
|
"kind": "Content",
|
|
7539
|
-
"text": "
|
|
8124
|
+
"text": ", 'ai_service_error'>;\n code?: never;\n terminal?: never;\n } | {\n ok: false;\n result?: never;\n reason: 'ai_service_error';\n code: "
|
|
8125
|
+
},
|
|
8126
|
+
{
|
|
8127
|
+
"kind": "Reference",
|
|
8128
|
+
"text": "AIServiceRefusal",
|
|
8129
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceRefusal:type"
|
|
8130
|
+
},
|
|
8131
|
+
{
|
|
8132
|
+
"kind": "Content",
|
|
8133
|
+
"text": ";\n terminal: boolean;\n }>;\n completeSubAgent?: (result: unknown) => void;\n releaseAgent?: () => void;\n endPhase?: () => void;\n condenseWhen: (policy: "
|
|
7540
8134
|
},
|
|
7541
8135
|
{
|
|
7542
8136
|
"kind": "Reference",
|
|
@@ -7545,7 +8139,16 @@
|
|
|
7545
8139
|
},
|
|
7546
8140
|
{
|
|
7547
8141
|
"kind": "Content",
|
|
7548
|
-
"text": ") => void;\n
|
|
8142
|
+
"text": ") => void;\n turnSignal?: "
|
|
8143
|
+
},
|
|
8144
|
+
{
|
|
8145
|
+
"kind": "Reference",
|
|
8146
|
+
"text": "AbortSignal",
|
|
8147
|
+
"canonicalReference": "!AbortSignal:interface"
|
|
8148
|
+
},
|
|
8149
|
+
{
|
|
8150
|
+
"kind": "Content",
|
|
8151
|
+
"text": ";\n}) => "
|
|
7549
8152
|
},
|
|
7550
8153
|
{
|
|
7551
8154
|
"kind": "Reference",
|
|
@@ -7579,7 +8182,7 @@
|
|
|
7579
8182
|
],
|
|
7580
8183
|
"typeTokenRange": {
|
|
7581
8184
|
"startIndex": 5,
|
|
7582
|
-
"endIndex":
|
|
8185
|
+
"endIndex": 29
|
|
7583
8186
|
}
|
|
7584
8187
|
},
|
|
7585
8188
|
{
|
|
@@ -9481,6 +10084,52 @@
|
|
|
9481
10084
|
],
|
|
9482
10085
|
"extendsTokenRanges": []
|
|
9483
10086
|
},
|
|
10087
|
+
{
|
|
10088
|
+
"kind": "Variable",
|
|
10089
|
+
"canonicalReference": "@genesislcap/foundation-ai!DEFAULT_AI_SERVICE_ERROR_MESSAGES:var",
|
|
10090
|
+
"docComment": "/**\n * What the user sees for each code and access refusal. Written for the app's user, with a hint for whoever runs it, and never quoting the server: its text goes to the console only. A host can replace any of them (`aiServiceErrorMessages` on the assistant).\n *\n * @beta\n */\n",
|
|
10091
|
+
"excerptTokens": [
|
|
10092
|
+
{
|
|
10093
|
+
"kind": "Content",
|
|
10094
|
+
"text": "DEFAULT_AI_SERVICE_ERROR_MESSAGES: "
|
|
10095
|
+
},
|
|
10096
|
+
{
|
|
10097
|
+
"kind": "Reference",
|
|
10098
|
+
"text": "Readonly",
|
|
10099
|
+
"canonicalReference": "!Readonly:type"
|
|
10100
|
+
},
|
|
10101
|
+
{
|
|
10102
|
+
"kind": "Content",
|
|
10103
|
+
"text": "<"
|
|
10104
|
+
},
|
|
10105
|
+
{
|
|
10106
|
+
"kind": "Reference",
|
|
10107
|
+
"text": "Record",
|
|
10108
|
+
"canonicalReference": "!Record:type"
|
|
10109
|
+
},
|
|
10110
|
+
{
|
|
10111
|
+
"kind": "Content",
|
|
10112
|
+
"text": "<"
|
|
10113
|
+
},
|
|
10114
|
+
{
|
|
10115
|
+
"kind": "Reference",
|
|
10116
|
+
"text": "AIServiceRefusal",
|
|
10117
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceRefusal:type"
|
|
10118
|
+
},
|
|
10119
|
+
{
|
|
10120
|
+
"kind": "Content",
|
|
10121
|
+
"text": ", string>>"
|
|
10122
|
+
}
|
|
10123
|
+
],
|
|
10124
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
10125
|
+
"isReadonly": true,
|
|
10126
|
+
"releaseTag": "Beta",
|
|
10127
|
+
"name": "DEFAULT_AI_SERVICE_ERROR_MESSAGES",
|
|
10128
|
+
"variableTypeTokenRange": {
|
|
10129
|
+
"startIndex": 1,
|
|
10130
|
+
"endIndex": 7
|
|
10131
|
+
}
|
|
10132
|
+
},
|
|
9484
10133
|
{
|
|
9485
10134
|
"kind": "Variable",
|
|
9486
10135
|
"canonicalReference": "@genesislcap/foundation-ai!DEFAULT_AI_TIERS:var",
|
|
@@ -11131,6 +11780,34 @@
|
|
|
11131
11780
|
"endIndex": 2
|
|
11132
11781
|
}
|
|
11133
11782
|
},
|
|
11783
|
+
{
|
|
11784
|
+
"kind": "PropertySignature",
|
|
11785
|
+
"canonicalReference": "@genesislcap/foundation-ai!InteractionRequestOptions#signal:member",
|
|
11786
|
+
"docComment": "/**\n * Closes the interaction when it aborts, exactly as an unanswered one closes at `timeoutMs`: the widget goes read-only and `requestInteraction` resolves with `status: 'timeout'`. A tool handler passes its `turnSignal`, so a user's Stop closes a widget left open instead of leaving the turn parked on it, and nothing the user clicks afterwards is taken as an answer.\n */\n",
|
|
11787
|
+
"excerptTokens": [
|
|
11788
|
+
{
|
|
11789
|
+
"kind": "Content",
|
|
11790
|
+
"text": "signal?: "
|
|
11791
|
+
},
|
|
11792
|
+
{
|
|
11793
|
+
"kind": "Reference",
|
|
11794
|
+
"text": "AbortSignal",
|
|
11795
|
+
"canonicalReference": "!AbortSignal:interface"
|
|
11796
|
+
},
|
|
11797
|
+
{
|
|
11798
|
+
"kind": "Content",
|
|
11799
|
+
"text": ";"
|
|
11800
|
+
}
|
|
11801
|
+
],
|
|
11802
|
+
"isReadonly": false,
|
|
11803
|
+
"isOptional": true,
|
|
11804
|
+
"releaseTag": "Beta",
|
|
11805
|
+
"name": "signal",
|
|
11806
|
+
"propertyTypeTokenRange": {
|
|
11807
|
+
"startIndex": 1,
|
|
11808
|
+
"endIndex": 2
|
|
11809
|
+
}
|
|
11810
|
+
},
|
|
11134
11811
|
{
|
|
11135
11812
|
"kind": "PropertySignature",
|
|
11136
11813
|
"canonicalReference": "@genesislcap/foundation-ai!InteractionRequestOptions#timeoutMs:member",
|
|
@@ -11418,6 +12095,48 @@
|
|
|
11418
12095
|
"parameters": [],
|
|
11419
12096
|
"name": "isSpeechRecognitionAvailable"
|
|
11420
12097
|
},
|
|
12098
|
+
{
|
|
12099
|
+
"kind": "Function",
|
|
12100
|
+
"canonicalReference": "@genesislcap/foundation-ai!isTerminalAIServiceRefusal:function(1)",
|
|
12101
|
+
"docComment": "/**\n * Whether sending the same request again gets the same refusal. Every code but `VENDOR_UNREACHABLE` does, until someone changes the configuration or the user's session or rights.\n *\n * @beta\n */\n",
|
|
12102
|
+
"excerptTokens": [
|
|
12103
|
+
{
|
|
12104
|
+
"kind": "Content",
|
|
12105
|
+
"text": "isTerminalAIServiceRefusal: (code: "
|
|
12106
|
+
},
|
|
12107
|
+
{
|
|
12108
|
+
"kind": "Reference",
|
|
12109
|
+
"text": "AIServiceRefusal",
|
|
12110
|
+
"canonicalReference": "@genesislcap/foundation-ai!AIServiceRefusal:type"
|
|
12111
|
+
},
|
|
12112
|
+
{
|
|
12113
|
+
"kind": "Content",
|
|
12114
|
+
"text": ") => "
|
|
12115
|
+
},
|
|
12116
|
+
{
|
|
12117
|
+
"kind": "Content",
|
|
12118
|
+
"text": "boolean"
|
|
12119
|
+
}
|
|
12120
|
+
],
|
|
12121
|
+
"fileUrlPath": "src/transports/ai-service-error.ts",
|
|
12122
|
+
"returnTypeTokenRange": {
|
|
12123
|
+
"startIndex": 3,
|
|
12124
|
+
"endIndex": 4
|
|
12125
|
+
},
|
|
12126
|
+
"releaseTag": "Beta",
|
|
12127
|
+
"overloadIndex": 1,
|
|
12128
|
+
"parameters": [
|
|
12129
|
+
{
|
|
12130
|
+
"parameterName": "code",
|
|
12131
|
+
"parameterTypeTokenRange": {
|
|
12132
|
+
"startIndex": 1,
|
|
12133
|
+
"endIndex": 2
|
|
12134
|
+
},
|
|
12135
|
+
"isOptional": false
|
|
12136
|
+
}
|
|
12137
|
+
],
|
|
12138
|
+
"name": "isTerminalAIServiceRefusal"
|
|
12139
|
+
},
|
|
11421
12140
|
{
|
|
11422
12141
|
"kind": "Class",
|
|
11423
12142
|
"canonicalReference": "@genesislcap/foundation-ai!MalformedFunctionCallError:class",
|
|
@@ -13501,7 +14220,7 @@
|
|
|
13501
14220
|
{
|
|
13502
14221
|
"kind": "TypeAlias",
|
|
13503
14222
|
"canonicalReference": "@genesislcap/foundation-ai!SubAgentFailureReason:type",
|
|
13504
|
-
"docComment": "/**\n * Why a sub-agent run ended without producing a structured result via `completeSubAgent`. Surfaced on the `{ ok: false }` branch of `requestSubAgent` so the parent tool handler can decide how to recover.\n *\n * - `max_iterations` — the sub-agent's tool loop ended without calling its completion tool (hit the iteration cap, or — defensively — a provider ignored forced tool use and returned a free-text turn). - `malformed_tool_call` — the provider repeatedly returned an unparseable tool call (e.g. Gemini `MALFORMED_FUNCTION_CALL`) after retries. - `empty_response` — the model repeatedly returned an empty response after retries. - `unknown_tool_limit` — the model repeatedly called tools that aren't available to it. - `timeout` — the sub-agent did not finish within {@link SubAgentRequestOptions.timeoutMs} (its run was aborted), or a transport request timed out inside the child's own run. - `response_truncated` — a turn stopped at the provider's output-token cap with an incomplete tool call; deterministic, so it is not retried. - `refusal` — a safety-classifier decline (e.g. Fable 5 `stop_reason: 'refusal'`), which returns empty content; deterministic, so it is not retried. - `budget_exhausted` — the AI-spend budget is used up and the proxy refused the request (HTTP 402). **Terminal for the parent too, and enforced**: the parent driver ends its own turn as soon as this outcome comes back, instead of appending it as a tool result and calling the model again into the same wall. So a handler that receives it will not be called a second time this turn, and the parent turn reports `'budget-exhausted'` in its own right.\n *\n * Recovery guidance differs sharply by reason — see `docs/sub_agent.md`.
|
|
14223
|
+
"docComment": "/**\n * Why a sub-agent run ended without producing a structured result via `completeSubAgent`. Surfaced on the `{ ok: false }` branch of `requestSubAgent` so the parent tool handler can decide how to recover.\n *\n * - `max_iterations` — the sub-agent's tool loop ended without calling its completion tool (hit the iteration cap, or — defensively — a provider ignored forced tool use and returned a free-text turn). - `malformed_tool_call` — the provider repeatedly returned an unparseable tool call (e.g. Gemini `MALFORMED_FUNCTION_CALL`) after retries. - `empty_response` — the model repeatedly returned an empty response after retries. - `unknown_tool_limit` — the model repeatedly called tools that aren't available to it. - `timeout` — the sub-agent did not finish within {@link SubAgentRequestOptions.timeoutMs} (its run was aborted), or a transport request timed out inside the child's own run. - `response_truncated` — a turn stopped at the provider's output-token cap with an incomplete tool call; deterministic, so it is not retried. - `refusal` — a safety-classifier decline (e.g. Fable 5 `stop_reason: 'refusal'`), which returns empty content; deterministic, so it is not retried. - `budget_exhausted` — the AI-spend budget is used up and the proxy refused the request (HTTP 402). **Terminal for the parent too, and enforced**: the parent driver ends its own turn as soon as this outcome comes back, instead of appending it as a tool result and calling the model again into the same wall. So a handler that receives it will not be called a second time this turn, and the parent turn reports `'budget-exhausted'` in its own right.\n *\n * Recovery guidance differs sharply by reason — see `docs/sub_agent.md`. `budget_exhausted`, `refusal`, `provider_refused`, `context_exhausted` and a `terminal` `ai_service_error` are terminal: retrying any of them with the same request just reproduces it. The rest are worth a retry or a question to the user.\n *\n * @beta\n */\n",
|
|
13505
14224
|
"excerptTokens": [
|
|
13506
14225
|
{
|
|
13507
14226
|
"kind": "Content",
|
|
@@ -13509,7 +14228,7 @@
|
|
|
13509
14228
|
},
|
|
13510
14229
|
{
|
|
13511
14230
|
"kind": "Content",
|
|
13512
|
-
"text": "'max_iterations' | 'malformed_tool_call' | 'empty_response' | 'unknown_tool_limit' | 'timeout' | 'response_truncated' | 'refusal' | 'budget_exhausted'\n/**\n * The upstream vendor refused the account (GENC-1506). **Terminal for the PARENT turn too**, on the\n * same reasoning as `budget_exhausted`: the parent cannot recover by calling the model again,\n * because the very next call hits the same wall. N batched sub-agent calls would otherwise cost N\n * doomed children AND a doomed parent call.\n */\n | 'provider_refused'\n/**\n * The sub-agent was stopped because continuing would have overrun the context\n *
|
|
14231
|
+
"text": "'max_iterations' | 'malformed_tool_call' | 'empty_response' | 'unknown_tool_limit' | 'timeout' | 'response_truncated' | 'refusal' | 'budget_exhausted'\n/**\n * The upstream vendor refused the account (GENC-1506). **Terminal for the PARENT turn too**, on the\n * same reasoning as `budget_exhausted`: the parent cannot recover by calling the model again,\n * because the very next call hits the same wall. N batched sub-agent calls would otherwise cost N\n * doomed children AND a doomed parent call.\n */\n | 'provider_refused'\n/**\n * The sub-agent was stopped because continuing would have overrun the context window\n * (GENC-1567). Re-invoking it with the same conversation stops it the same way. The parent's turn\n * goes on, but it shares the conversation whose size caused this, so its own next model call is\n * likely to stop on the same guard.\n */\n | 'context_exhausted'\n/**\n * The app's AI service refused the sub-agent's request (GENC-1611). The outcome carries the\n * refusal's `code` and whether it is `terminal`: re-invoking the sub-agent with the same request\n * gets the same refusal, so recover without calling it again. Only a `VENDOR_UNREACHABLE` refusal\n * is not terminal. Even so, a refusal from your own vendor that is about the service (for example\n * `VENDOR_UNREACHABLE`) still ends this turn; retry on the user's next message, not in the\n * handler.\n *\n * **Terminal for the PARENT turn too only when** the refusal is about the service rather than the\n * child's own request (a missing or unusable key, no session or no right, the vendor unreachable)\n * and the child called the parent's own vendor, unless a completion or a handoff from the same\n * batch goes on past it. Otherwise the parent is told and its turn goes on. The user is shown a\n * key, access, model (`MODEL_NOT_ALLOWED`) or reachability refusal's sentence once per user\n * message; `REQUEST_TOO_LARGE`, `BAD_REQUEST` and `FALLBACKS_NOT_SUPPORTED` are left to the parent\n * and the console.\n */\n | 'ai_service_error'"
|
|
13513
14232
|
},
|
|
13514
14233
|
{
|
|
13515
14234
|
"kind": "Content",
|
|
@@ -14082,7 +14801,7 @@
|
|
|
14082
14801
|
},
|
|
14083
14802
|
{
|
|
14084
14803
|
"kind": "Content",
|
|
14085
|
-
"text": "'exception' | 'malformed-function-call' | 'empty-response' | 'unknown-tool-limit' | 'max-iterations' | 'response-truncated' | 'refusal' | 'budget-exhausted' | 'provider-refused'\n/**\n * The turn was stopped because continuing it would have overrun the model's\n * context window (GENC-1567). Pre-emptive: the driver ends the tool loop at\n * the edge rather than issuing a request the provider would reject, so the\n * transcript stays intact and compaction is still possible.\n */\n | 'context-exhausted'"
|
|
14804
|
+
"text": "'exception' | 'malformed-function-call' | 'empty-response' | 'unknown-tool-limit' | 'max-iterations' | 'response-truncated' | 'refusal' | 'budget-exhausted' | 'provider-refused'\n/**\n * The turn was stopped because continuing it would have overrun the model's\n * context window (GENC-1567). Pre-emptive: the driver ends the tool loop at\n * the edge rather than issuing a request the provider would reject, so the\n * transcript stays intact and compaction is still possible.\n */\n | 'context-exhausted'\n/**\n * The app's AI service refused the request with one of `AI_SERVICE_ERROR_CODES` (GENC-1611): a\n * configuration error such as a missing API key, or the vendor still unreachable after the\n * retries. The transcript says what is wrong in words for the user.\n */\n | 'ai-service-error'"
|
|
14086
14805
|
},
|
|
14087
14806
|
{
|
|
14088
14807
|
"kind": "Content",
|