@ouispec/contract 0.4.9 → 0.5.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/INTEGRATOR-GUIDE.md +203 -3
- package/dist/generated/contract.d.ts +320 -2
- package/dist/generated/contract.d.ts.map +1 -1
- package/dist/generated/schemas.d.ts +32 -0
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +871 -1
- package/dist/generated/schemas.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-contract.js +2 -0
- package/dist/render-contract.js.map +1 -1
- package/package.json +1 -1
- package/schemas/agent-evals.json +219 -0
- package/schemas/conversation-takeover.json +410 -0
- package/schemas/event-declarations.json +1 -1
|
@@ -3286,7 +3286,7 @@ export const CONTRACT_SCHEMAS = {
|
|
|
3286
3286
|
"pattern": "^[A-Z][A-Za-z0-9]*$"
|
|
3287
3287
|
},
|
|
3288
3288
|
"rooms": {
|
|
3289
|
-
"description": "The rooms the event is published to: names from the document's `rooms
|
|
3289
|
+
"description": "The rooms the event is published to: names from the document's `rooms`; `turn` for the room of the agent turn it belongs to (the host names that room in each turn); or `conversation` for the room of the conversation it belongs to (the host names that room too).",
|
|
3290
3290
|
"type": "array",
|
|
3291
3291
|
"items": {
|
|
3292
3292
|
"type": "string",
|
|
@@ -3399,6 +3399,846 @@ export const CONTRACT_SCHEMAS = {
|
|
|
3399
3399
|
}
|
|
3400
3400
|
}
|
|
3401
3401
|
},
|
|
3402
|
+
'conversation-takeover.json': {
|
|
3403
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3404
|
+
"$id": "https://schemas.closurestudio.ai/oui/v1/conversation-takeover.json",
|
|
3405
|
+
"title": "Conversation takeover",
|
|
3406
|
+
"description": "A person on the product's staff takes a live conversation from the agent, answers the customer as themselves, and hands it back: the shapes the realtime server, the agent worker, the product's API, the customer's tab and the staff console exchange.\n\n1. The product's own route checks that this person may take this conversation, then asks the realtime server to hold it (`POST /internal/conversations/{id}/hold`, `TakeOverRequest`). The server keeps one `ConversationHold`, stops any turn of the conversation that is running, and sends `agent:conversation_taken_over` (`ConversationTakenOverEvent`) to the conversation's room.\n2. While the conversation is held, the agent does not answer: a turn that arrives is not run by the model.\n3. The person's messages are stored by the product with `role: 'staff'` and their speaker, and announced (`POST /internal/conversations/{id}/messages`, `AnnounceMessageRequest`) as `agent:conversation_message` (`ConversationMessageEvent`), only while they hold the conversation.\n4. The holder, or the product on its own authority, hands it back (`POST /internal/conversations/{id}/hold/release`, `HandBackRequest`); `agent:conversation_handed_back` (`ConversationHandedBackEvent`) follows, and the agent's next turn reads the whole exchange in its history.\n\nThe realtime server never decides who may take over: its routes take the internal key, and the product calls them after its own check, as it does before it asks for a room token.",
|
|
3407
|
+
"$defs": {
|
|
3408
|
+
"StaffSpeaker": {
|
|
3409
|
+
"description": "A person on the product's staff, as the conversation names them. `displayName` and `role` are shown to the customer; `userId` is what a hand-back and a staff message are checked against. It reaches the customer's tab, so name an id you are content to show (an opaque staff id).",
|
|
3410
|
+
"type": "object",
|
|
3411
|
+
"properties": {
|
|
3412
|
+
"userId": {
|
|
3413
|
+
"description": "The staff member's id, as the product's realtime identity names them.",
|
|
3414
|
+
"type": "string",
|
|
3415
|
+
"minLength": 1,
|
|
3416
|
+
"maxLength": 200
|
|
3417
|
+
},
|
|
3418
|
+
"displayName": {
|
|
3419
|
+
"description": "The name the customer sees (\"Jordan\").",
|
|
3420
|
+
"type": "string",
|
|
3421
|
+
"minLength": 1,
|
|
3422
|
+
"maxLength": 80
|
|
3423
|
+
},
|
|
3424
|
+
"role": {
|
|
3425
|
+
"description": "What the customer sees beside the name (\"Toyota of Quillhaven sales\").",
|
|
3426
|
+
"type": "string",
|
|
3427
|
+
"minLength": 1,
|
|
3428
|
+
"maxLength": 80
|
|
3429
|
+
}
|
|
3430
|
+
},
|
|
3431
|
+
"required": [
|
|
3432
|
+
"userId",
|
|
3433
|
+
"displayName"
|
|
3434
|
+
],
|
|
3435
|
+
"additionalProperties": false
|
|
3436
|
+
},
|
|
3437
|
+
"ConversationHold": {
|
|
3438
|
+
"description": "A conversation a person holds: the agent does not answer it until it is handed back. One holder at a time.",
|
|
3439
|
+
"type": "object",
|
|
3440
|
+
"properties": {
|
|
3441
|
+
"conversationId": {
|
|
3442
|
+
"type": "string",
|
|
3443
|
+
"minLength": 1
|
|
3444
|
+
},
|
|
3445
|
+
"holder": {
|
|
3446
|
+
"$ref": "#/$defs/StaffSpeaker"
|
|
3447
|
+
},
|
|
3448
|
+
"since": {
|
|
3449
|
+
"description": "When it was taken, epoch ms by the realtime server's clock.",
|
|
3450
|
+
"type": "number"
|
|
3451
|
+
}
|
|
3452
|
+
},
|
|
3453
|
+
"required": [
|
|
3454
|
+
"conversationId",
|
|
3455
|
+
"holder",
|
|
3456
|
+
"since"
|
|
3457
|
+
],
|
|
3458
|
+
"additionalProperties": false
|
|
3459
|
+
},
|
|
3460
|
+
"TakeoverChange": {
|
|
3461
|
+
"description": "A conversation changing hands, as its stored entry and its event say: `taken_over` by a person, `handed_back` to the agent.",
|
|
3462
|
+
"enum": [
|
|
3463
|
+
"taken_over",
|
|
3464
|
+
"handed_back"
|
|
3465
|
+
]
|
|
3466
|
+
},
|
|
3467
|
+
"HandBackCause": {
|
|
3468
|
+
"description": "Who ended a hold: the person who held it (`holder`), or the product on its own authority (`product`: an idle policy, a manager, the end of a shift).",
|
|
3469
|
+
"enum": [
|
|
3470
|
+
"holder",
|
|
3471
|
+
"product"
|
|
3472
|
+
]
|
|
3473
|
+
},
|
|
3474
|
+
"ConversationMessageRole": {
|
|
3475
|
+
"description": "Who wrote a message of the conversation: the customer (`user`), the agent (`assistant`), or a person on the staff (`staff`).",
|
|
3476
|
+
"enum": [
|
|
3477
|
+
"user",
|
|
3478
|
+
"assistant",
|
|
3479
|
+
"staff"
|
|
3480
|
+
]
|
|
3481
|
+
},
|
|
3482
|
+
"ConversationMessage": {
|
|
3483
|
+
"description": "A stored message of the conversation, as it is announced to the people watching it.",
|
|
3484
|
+
"type": "object",
|
|
3485
|
+
"properties": {
|
|
3486
|
+
"id": {
|
|
3487
|
+
"description": "The product's id for the stored message.",
|
|
3488
|
+
"type": "string",
|
|
3489
|
+
"minLength": 1,
|
|
3490
|
+
"maxLength": 200
|
|
3491
|
+
},
|
|
3492
|
+
"role": {
|
|
3493
|
+
"$ref": "#/$defs/ConversationMessageRole"
|
|
3494
|
+
},
|
|
3495
|
+
"content": {
|
|
3496
|
+
"type": "string",
|
|
3497
|
+
"maxLength": 100000
|
|
3498
|
+
},
|
|
3499
|
+
"createdAt": {
|
|
3500
|
+
"description": "When it was stored, ISO 8601.",
|
|
3501
|
+
"type": "string",
|
|
3502
|
+
"minLength": 1
|
|
3503
|
+
},
|
|
3504
|
+
"speaker": {
|
|
3505
|
+
"description": "Set on a `staff` message: who wrote it.",
|
|
3506
|
+
"$ref": "#/$defs/StaffSpeaker"
|
|
3507
|
+
}
|
|
3508
|
+
},
|
|
3509
|
+
"required": [
|
|
3510
|
+
"id",
|
|
3511
|
+
"role",
|
|
3512
|
+
"content",
|
|
3513
|
+
"createdAt"
|
|
3514
|
+
],
|
|
3515
|
+
"additionalProperties": false
|
|
3516
|
+
},
|
|
3517
|
+
"ConversationRooms": {
|
|
3518
|
+
"description": "Where a conversation's event goes: the conversation's room, which the product names and guards with a room token, and any of the product's own (a team's board).",
|
|
3519
|
+
"type": "array",
|
|
3520
|
+
"items": {
|
|
3521
|
+
"type": "string",
|
|
3522
|
+
"minLength": 1
|
|
3523
|
+
},
|
|
3524
|
+
"minItems": 1,
|
|
3525
|
+
"maxItems": 5,
|
|
3526
|
+
"uniqueItems": true
|
|
3527
|
+
},
|
|
3528
|
+
"TakeOverRequest": {
|
|
3529
|
+
"description": "`POST /internal/conversations/{conversationId}/hold`, from the product's API after its own check that this person may take this conversation.",
|
|
3530
|
+
"type": "object",
|
|
3531
|
+
"properties": {
|
|
3532
|
+
"holder": {
|
|
3533
|
+
"$ref": "#/$defs/StaffSpeaker"
|
|
3534
|
+
},
|
|
3535
|
+
"rooms": {
|
|
3536
|
+
"$ref": "#/$defs/ConversationRooms"
|
|
3537
|
+
}
|
|
3538
|
+
},
|
|
3539
|
+
"required": [
|
|
3540
|
+
"holder",
|
|
3541
|
+
"rooms"
|
|
3542
|
+
],
|
|
3543
|
+
"additionalProperties": false
|
|
3544
|
+
},
|
|
3545
|
+
"TakeOverResult": {
|
|
3546
|
+
"description": "The answer to a take-over: `taken_over` the first time, with the approvals it withdrew; `already` when this holder had it; 409 `held` when someone else holds it.",
|
|
3547
|
+
"oneOf": [
|
|
3548
|
+
{
|
|
3549
|
+
"type": "object",
|
|
3550
|
+
"properties": {
|
|
3551
|
+
"ok": {
|
|
3552
|
+
"const": true
|
|
3553
|
+
},
|
|
3554
|
+
"change": {
|
|
3555
|
+
"enum": [
|
|
3556
|
+
"taken_over",
|
|
3557
|
+
"already"
|
|
3558
|
+
]
|
|
3559
|
+
},
|
|
3560
|
+
"hold": {
|
|
3561
|
+
"$ref": "#/$defs/ConversationHold"
|
|
3562
|
+
},
|
|
3563
|
+
"withdrawn": {
|
|
3564
|
+
"description": "On `taken_over`: the ids of the conversation's approvals that were waiting, or approved and not yet used, and are now withdrawn (`taken_over`), since the person now answering asked for none of them. Empty when there were none.",
|
|
3565
|
+
"type": "array",
|
|
3566
|
+
"items": {
|
|
3567
|
+
"type": "string"
|
|
3568
|
+
}
|
|
3569
|
+
}
|
|
3570
|
+
},
|
|
3571
|
+
"required": [
|
|
3572
|
+
"ok",
|
|
3573
|
+
"change",
|
|
3574
|
+
"hold"
|
|
3575
|
+
],
|
|
3576
|
+
"additionalProperties": false
|
|
3577
|
+
},
|
|
3578
|
+
{
|
|
3579
|
+
"type": "object",
|
|
3580
|
+
"properties": {
|
|
3581
|
+
"ok": {
|
|
3582
|
+
"const": false
|
|
3583
|
+
},
|
|
3584
|
+
"reason": {
|
|
3585
|
+
"const": "held"
|
|
3586
|
+
},
|
|
3587
|
+
"hold": {
|
|
3588
|
+
"$ref": "#/$defs/ConversationHold"
|
|
3589
|
+
}
|
|
3590
|
+
},
|
|
3591
|
+
"required": [
|
|
3592
|
+
"ok",
|
|
3593
|
+
"reason",
|
|
3594
|
+
"hold"
|
|
3595
|
+
],
|
|
3596
|
+
"additionalProperties": false
|
|
3597
|
+
}
|
|
3598
|
+
]
|
|
3599
|
+
},
|
|
3600
|
+
"HandBackRequest": {
|
|
3601
|
+
"description": "`POST /internal/conversations/{conversationId}/hold/release`. With `userId`, only the holder may hand it back; without it, the product releases it on its own authority.",
|
|
3602
|
+
"type": "object",
|
|
3603
|
+
"properties": {
|
|
3604
|
+
"userId": {
|
|
3605
|
+
"description": "The staff member handing it back; must be the holder.",
|
|
3606
|
+
"type": "string",
|
|
3607
|
+
"minLength": 1
|
|
3608
|
+
},
|
|
3609
|
+
"rooms": {
|
|
3610
|
+
"$ref": "#/$defs/ConversationRooms"
|
|
3611
|
+
}
|
|
3612
|
+
},
|
|
3613
|
+
"required": [
|
|
3614
|
+
"rooms"
|
|
3615
|
+
],
|
|
3616
|
+
"additionalProperties": false
|
|
3617
|
+
},
|
|
3618
|
+
"HandBackResult": {
|
|
3619
|
+
"description": "The answer to a hand-back: `handed_back` with the hold that ended, `not_held` when nobody held it; 409 `not_holder` when someone else holds it.",
|
|
3620
|
+
"oneOf": [
|
|
3621
|
+
{
|
|
3622
|
+
"type": "object",
|
|
3623
|
+
"properties": {
|
|
3624
|
+
"ok": {
|
|
3625
|
+
"const": true
|
|
3626
|
+
},
|
|
3627
|
+
"change": {
|
|
3628
|
+
"const": "handed_back"
|
|
3629
|
+
},
|
|
3630
|
+
"hold": {
|
|
3631
|
+
"$ref": "#/$defs/ConversationHold"
|
|
3632
|
+
},
|
|
3633
|
+
"by": {
|
|
3634
|
+
"$ref": "#/$defs/HandBackCause"
|
|
3635
|
+
}
|
|
3636
|
+
},
|
|
3637
|
+
"required": [
|
|
3638
|
+
"ok",
|
|
3639
|
+
"change",
|
|
3640
|
+
"hold",
|
|
3641
|
+
"by"
|
|
3642
|
+
],
|
|
3643
|
+
"additionalProperties": false
|
|
3644
|
+
},
|
|
3645
|
+
{
|
|
3646
|
+
"type": "object",
|
|
3647
|
+
"properties": {
|
|
3648
|
+
"ok": {
|
|
3649
|
+
"const": true
|
|
3650
|
+
},
|
|
3651
|
+
"change": {
|
|
3652
|
+
"const": "not_held"
|
|
3653
|
+
}
|
|
3654
|
+
},
|
|
3655
|
+
"required": [
|
|
3656
|
+
"ok",
|
|
3657
|
+
"change"
|
|
3658
|
+
],
|
|
3659
|
+
"additionalProperties": false
|
|
3660
|
+
},
|
|
3661
|
+
{
|
|
3662
|
+
"type": "object",
|
|
3663
|
+
"properties": {
|
|
3664
|
+
"ok": {
|
|
3665
|
+
"const": false
|
|
3666
|
+
},
|
|
3667
|
+
"reason": {
|
|
3668
|
+
"const": "not_holder"
|
|
3669
|
+
},
|
|
3670
|
+
"hold": {
|
|
3671
|
+
"$ref": "#/$defs/ConversationHold"
|
|
3672
|
+
}
|
|
3673
|
+
},
|
|
3674
|
+
"required": [
|
|
3675
|
+
"ok",
|
|
3676
|
+
"reason",
|
|
3677
|
+
"hold"
|
|
3678
|
+
],
|
|
3679
|
+
"additionalProperties": false
|
|
3680
|
+
}
|
|
3681
|
+
]
|
|
3682
|
+
},
|
|
3683
|
+
"AnnounceMessageRequest": {
|
|
3684
|
+
"description": "`POST /internal/conversations/{conversationId}/messages`: a message the product has stored, for the people watching the conversation. A `staff` message is announced only while its speaker holds the conversation.",
|
|
3685
|
+
"type": "object",
|
|
3686
|
+
"properties": {
|
|
3687
|
+
"message": {
|
|
3688
|
+
"$ref": "#/$defs/ConversationMessage"
|
|
3689
|
+
},
|
|
3690
|
+
"rooms": {
|
|
3691
|
+
"$ref": "#/$defs/ConversationRooms"
|
|
3692
|
+
}
|
|
3693
|
+
},
|
|
3694
|
+
"required": [
|
|
3695
|
+
"message",
|
|
3696
|
+
"rooms"
|
|
3697
|
+
],
|
|
3698
|
+
"additionalProperties": false
|
|
3699
|
+
},
|
|
3700
|
+
"AnnounceMessageResult": {
|
|
3701
|
+
"description": "The answer to an announcement: sent, or 409 because its staff speaker does not hold the conversation (`not_held`: nobody does; `not_holder`: someone else does).",
|
|
3702
|
+
"oneOf": [
|
|
3703
|
+
{
|
|
3704
|
+
"type": "object",
|
|
3705
|
+
"properties": {
|
|
3706
|
+
"ok": {
|
|
3707
|
+
"const": true
|
|
3708
|
+
}
|
|
3709
|
+
},
|
|
3710
|
+
"required": [
|
|
3711
|
+
"ok"
|
|
3712
|
+
],
|
|
3713
|
+
"additionalProperties": false
|
|
3714
|
+
},
|
|
3715
|
+
{
|
|
3716
|
+
"type": "object",
|
|
3717
|
+
"properties": {
|
|
3718
|
+
"ok": {
|
|
3719
|
+
"const": false
|
|
3720
|
+
},
|
|
3721
|
+
"reason": {
|
|
3722
|
+
"enum": [
|
|
3723
|
+
"not_held",
|
|
3724
|
+
"not_holder"
|
|
3725
|
+
]
|
|
3726
|
+
}
|
|
3727
|
+
},
|
|
3728
|
+
"required": [
|
|
3729
|
+
"ok",
|
|
3730
|
+
"reason"
|
|
3731
|
+
],
|
|
3732
|
+
"additionalProperties": false
|
|
3733
|
+
}
|
|
3734
|
+
]
|
|
3735
|
+
},
|
|
3736
|
+
"ConversationTakenOverEvent": {
|
|
3737
|
+
"description": "`agent:conversation_taken_over`, to the conversation's room: a person took it, and the agent stopped answering.",
|
|
3738
|
+
"type": "object",
|
|
3739
|
+
"properties": {
|
|
3740
|
+
"conversationId": {
|
|
3741
|
+
"type": "string",
|
|
3742
|
+
"minLength": 1
|
|
3743
|
+
},
|
|
3744
|
+
"hold": {
|
|
3745
|
+
"$ref": "#/$defs/ConversationHold"
|
|
3746
|
+
},
|
|
3747
|
+
"at": {
|
|
3748
|
+
"description": "Epoch ms.",
|
|
3749
|
+
"type": "number"
|
|
3750
|
+
}
|
|
3751
|
+
},
|
|
3752
|
+
"required": [
|
|
3753
|
+
"conversationId",
|
|
3754
|
+
"hold",
|
|
3755
|
+
"at"
|
|
3756
|
+
],
|
|
3757
|
+
"additionalProperties": false
|
|
3758
|
+
},
|
|
3759
|
+
"ConversationHandedBackEvent": {
|
|
3760
|
+
"description": "`agent:conversation_handed_back`, to the conversation's room: the hold ended, and the agent answers again.",
|
|
3761
|
+
"type": "object",
|
|
3762
|
+
"properties": {
|
|
3763
|
+
"conversationId": {
|
|
3764
|
+
"type": "string",
|
|
3765
|
+
"minLength": 1
|
|
3766
|
+
},
|
|
3767
|
+
"hold": {
|
|
3768
|
+
"description": "The hold that ended.",
|
|
3769
|
+
"$ref": "#/$defs/ConversationHold"
|
|
3770
|
+
},
|
|
3771
|
+
"by": {
|
|
3772
|
+
"$ref": "#/$defs/HandBackCause"
|
|
3773
|
+
},
|
|
3774
|
+
"at": {
|
|
3775
|
+
"description": "Epoch ms.",
|
|
3776
|
+
"type": "number"
|
|
3777
|
+
}
|
|
3778
|
+
},
|
|
3779
|
+
"required": [
|
|
3780
|
+
"conversationId",
|
|
3781
|
+
"hold",
|
|
3782
|
+
"by",
|
|
3783
|
+
"at"
|
|
3784
|
+
],
|
|
3785
|
+
"additionalProperties": false
|
|
3786
|
+
},
|
|
3787
|
+
"ConversationMessageEvent": {
|
|
3788
|
+
"description": "`agent:conversation_message`, to the conversation's room: a message the product stored, for the people watching.",
|
|
3789
|
+
"type": "object",
|
|
3790
|
+
"properties": {
|
|
3791
|
+
"conversationId": {
|
|
3792
|
+
"type": "string",
|
|
3793
|
+
"minLength": 1
|
|
3794
|
+
},
|
|
3795
|
+
"message": {
|
|
3796
|
+
"$ref": "#/$defs/ConversationMessage"
|
|
3797
|
+
},
|
|
3798
|
+
"at": {
|
|
3799
|
+
"description": "Epoch ms.",
|
|
3800
|
+
"type": "number"
|
|
3801
|
+
}
|
|
3802
|
+
},
|
|
3803
|
+
"required": [
|
|
3804
|
+
"conversationId",
|
|
3805
|
+
"message",
|
|
3806
|
+
"at"
|
|
3807
|
+
],
|
|
3808
|
+
"additionalProperties": false
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
},
|
|
3812
|
+
'agent-evals.json': {
|
|
3813
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3814
|
+
"$id": "https://schemas.closurestudio.ai/oui/v1/agent-evals.json",
|
|
3815
|
+
"title": "AgentEvalSuite",
|
|
3816
|
+
"description": "A suite of agent eval scenarios, written as data: what a customer says, turn by turn, and what must hold after each turn. `@ouispec/agent-evals` runs every scenario on every channel the suite names, against the product's real agent configuration (persona, tools, tool policy, turn policy), from recorded model responses in CI or against the live model, and fails on any assertion that does not hold.",
|
|
3817
|
+
"type": "object",
|
|
3818
|
+
"properties": {
|
|
3819
|
+
"version": {
|
|
3820
|
+
"description": "The suite format's version.",
|
|
3821
|
+
"const": 1
|
|
3822
|
+
},
|
|
3823
|
+
"name": {
|
|
3824
|
+
"description": "The suite's name, as reports show it.",
|
|
3825
|
+
"type": "string",
|
|
3826
|
+
"minLength": 1,
|
|
3827
|
+
"maxLength": 120
|
|
3828
|
+
},
|
|
3829
|
+
"description": {
|
|
3830
|
+
"type": "string"
|
|
3831
|
+
},
|
|
3832
|
+
"channels": {
|
|
3833
|
+
"description": "The channels every scenario runs on, as the eval configuration names them (`web_chat`, `sms`, `voice`). Default: every channel the configuration names.",
|
|
3834
|
+
"$ref": "#/$defs/AgentEvalChannelList"
|
|
3835
|
+
},
|
|
3836
|
+
"context": {
|
|
3837
|
+
"description": "What every turn of every scenario carries as its context, before the channel's and the scenario's own.",
|
|
3838
|
+
"type": "object",
|
|
3839
|
+
"additionalProperties": true
|
|
3840
|
+
},
|
|
3841
|
+
"stubs": {
|
|
3842
|
+
"description": "What each tool returns, for every scenario; a scenario's own stubs come first.",
|
|
3843
|
+
"$ref": "#/$defs/AgentEvalStubs"
|
|
3844
|
+
},
|
|
3845
|
+
"scenarios": {
|
|
3846
|
+
"type": "array",
|
|
3847
|
+
"items": {
|
|
3848
|
+
"$ref": "#/$defs/AgentEvalScenario"
|
|
3849
|
+
},
|
|
3850
|
+
"minItems": 1
|
|
3851
|
+
}
|
|
3852
|
+
},
|
|
3853
|
+
"required": [
|
|
3854
|
+
"version",
|
|
3855
|
+
"name",
|
|
3856
|
+
"scenarios"
|
|
3857
|
+
],
|
|
3858
|
+
"additionalProperties": false,
|
|
3859
|
+
"$defs": {
|
|
3860
|
+
"AgentEvalChannelList": {
|
|
3861
|
+
"description": "Channel names, as the eval configuration names them.",
|
|
3862
|
+
"type": "array",
|
|
3863
|
+
"items": {
|
|
3864
|
+
"type": "string",
|
|
3865
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
3866
|
+
},
|
|
3867
|
+
"minItems": 1,
|
|
3868
|
+
"uniqueItems": true
|
|
3869
|
+
},
|
|
3870
|
+
"AgentEvalScenario": {
|
|
3871
|
+
"description": "One conversation: its turns in order, and what must hold after each.",
|
|
3872
|
+
"type": "object",
|
|
3873
|
+
"properties": {
|
|
3874
|
+
"id": {
|
|
3875
|
+
"description": "Unique in the suite; names its recordings.",
|
|
3876
|
+
"type": "string",
|
|
3877
|
+
"pattern": "^[a-z0-9][a-z0-9_-]*$",
|
|
3878
|
+
"maxLength": 80
|
|
3879
|
+
},
|
|
3880
|
+
"title": {
|
|
3881
|
+
"description": "What it shows, as reports name it.",
|
|
3882
|
+
"type": "string",
|
|
3883
|
+
"minLength": 1
|
|
3884
|
+
},
|
|
3885
|
+
"description": {
|
|
3886
|
+
"type": "string"
|
|
3887
|
+
},
|
|
3888
|
+
"channels": {
|
|
3889
|
+
"description": "The suite's channels this scenario runs on, when not all of them.",
|
|
3890
|
+
"$ref": "#/$defs/AgentEvalChannelList"
|
|
3891
|
+
},
|
|
3892
|
+
"context": {
|
|
3893
|
+
"description": "What each of its turns carries as its context, after the suite's and the channel's.",
|
|
3894
|
+
"type": "object",
|
|
3895
|
+
"additionalProperties": true
|
|
3896
|
+
},
|
|
3897
|
+
"stubs": {
|
|
3898
|
+
"description": "What each tool returns in this scenario, before the suite's stubs.",
|
|
3899
|
+
"$ref": "#/$defs/AgentEvalStubs"
|
|
3900
|
+
},
|
|
3901
|
+
"turns": {
|
|
3902
|
+
"type": "array",
|
|
3903
|
+
"items": {
|
|
3904
|
+
"$ref": "#/$defs/AgentEvalTurn"
|
|
3905
|
+
},
|
|
3906
|
+
"minItems": 1
|
|
3907
|
+
}
|
|
3908
|
+
},
|
|
3909
|
+
"required": [
|
|
3910
|
+
"id",
|
|
3911
|
+
"title",
|
|
3912
|
+
"turns"
|
|
3913
|
+
],
|
|
3914
|
+
"additionalProperties": false
|
|
3915
|
+
},
|
|
3916
|
+
"AgentEvalTurn": {
|
|
3917
|
+
"description": "One step of a scenario: the customer says something, answers the waiting approval, or a person on the staff acts.",
|
|
3918
|
+
"oneOf": [
|
|
3919
|
+
{
|
|
3920
|
+
"$ref": "#/$defs/AgentEvalUserTurn"
|
|
3921
|
+
},
|
|
3922
|
+
{
|
|
3923
|
+
"$ref": "#/$defs/AgentEvalApprovalTurn"
|
|
3924
|
+
},
|
|
3925
|
+
{
|
|
3926
|
+
"$ref": "#/$defs/AgentEvalStaffTurn"
|
|
3927
|
+
}
|
|
3928
|
+
]
|
|
3929
|
+
},
|
|
3930
|
+
"AgentEvalUserTurn": {
|
|
3931
|
+
"description": "The customer's message: the agent's turn runs, and its expectations are checked.",
|
|
3932
|
+
"type": "object",
|
|
3933
|
+
"properties": {
|
|
3934
|
+
"user": {
|
|
3935
|
+
"type": "string",
|
|
3936
|
+
"minLength": 1
|
|
3937
|
+
},
|
|
3938
|
+
"expect": {
|
|
3939
|
+
"$ref": "#/$defs/AgentEvalExpectation"
|
|
3940
|
+
},
|
|
3941
|
+
"expectOn": {
|
|
3942
|
+
"$ref": "#/$defs/AgentEvalExpectationsByChannel"
|
|
3943
|
+
}
|
|
3944
|
+
},
|
|
3945
|
+
"required": [
|
|
3946
|
+
"user"
|
|
3947
|
+
],
|
|
3948
|
+
"additionalProperties": false
|
|
3949
|
+
},
|
|
3950
|
+
"AgentEvalApprovalTurn": {
|
|
3951
|
+
"description": "The customer's answer to the approval the last turn stopped at, decided on the channel's approval channel (the card on `ui`; the readback and an affirmative message on a conversation channel). The continuation turn runs, and its expectations are checked.",
|
|
3952
|
+
"type": "object",
|
|
3953
|
+
"properties": {
|
|
3954
|
+
"approval": {
|
|
3955
|
+
"enum": [
|
|
3956
|
+
"approve",
|
|
3957
|
+
"decline"
|
|
3958
|
+
]
|
|
3959
|
+
},
|
|
3960
|
+
"expect": {
|
|
3961
|
+
"$ref": "#/$defs/AgentEvalExpectation"
|
|
3962
|
+
},
|
|
3963
|
+
"expectOn": {
|
|
3964
|
+
"$ref": "#/$defs/AgentEvalExpectationsByChannel"
|
|
3965
|
+
}
|
|
3966
|
+
},
|
|
3967
|
+
"required": [
|
|
3968
|
+
"approval"
|
|
3969
|
+
],
|
|
3970
|
+
"additionalProperties": false
|
|
3971
|
+
},
|
|
3972
|
+
"AgentEvalStaffTurn": {
|
|
3973
|
+
"description": "A person on the staff takes the conversation over, writes to the customer, or hands it back. No agent turn runs.",
|
|
3974
|
+
"type": "object",
|
|
3975
|
+
"properties": {
|
|
3976
|
+
"staff": {
|
|
3977
|
+
"oneOf": [
|
|
3978
|
+
{
|
|
3979
|
+
"type": "object",
|
|
3980
|
+
"properties": {
|
|
3981
|
+
"takeOver": {
|
|
3982
|
+
"type": "object",
|
|
3983
|
+
"properties": {
|
|
3984
|
+
"displayName": {
|
|
3985
|
+
"type": "string",
|
|
3986
|
+
"minLength": 1,
|
|
3987
|
+
"maxLength": 80
|
|
3988
|
+
},
|
|
3989
|
+
"role": {
|
|
3990
|
+
"type": "string",
|
|
3991
|
+
"minLength": 1,
|
|
3992
|
+
"maxLength": 80
|
|
3993
|
+
},
|
|
3994
|
+
"userId": {
|
|
3995
|
+
"description": "Default: `staff-` and the display name.",
|
|
3996
|
+
"type": "string",
|
|
3997
|
+
"minLength": 1
|
|
3998
|
+
}
|
|
3999
|
+
},
|
|
4000
|
+
"required": [
|
|
4001
|
+
"displayName"
|
|
4002
|
+
],
|
|
4003
|
+
"additionalProperties": false
|
|
4004
|
+
}
|
|
4005
|
+
},
|
|
4006
|
+
"required": [
|
|
4007
|
+
"takeOver"
|
|
4008
|
+
],
|
|
4009
|
+
"additionalProperties": false
|
|
4010
|
+
},
|
|
4011
|
+
{
|
|
4012
|
+
"type": "object",
|
|
4013
|
+
"properties": {
|
|
4014
|
+
"say": {
|
|
4015
|
+
"type": "string",
|
|
4016
|
+
"minLength": 1
|
|
4017
|
+
}
|
|
4018
|
+
},
|
|
4019
|
+
"required": [
|
|
4020
|
+
"say"
|
|
4021
|
+
],
|
|
4022
|
+
"additionalProperties": false
|
|
4023
|
+
},
|
|
4024
|
+
{
|
|
4025
|
+
"type": "object",
|
|
4026
|
+
"properties": {
|
|
4027
|
+
"handBack": {
|
|
4028
|
+
"const": true
|
|
4029
|
+
}
|
|
4030
|
+
},
|
|
4031
|
+
"required": [
|
|
4032
|
+
"handBack"
|
|
4033
|
+
],
|
|
4034
|
+
"additionalProperties": false
|
|
4035
|
+
}
|
|
4036
|
+
]
|
|
4037
|
+
}
|
|
4038
|
+
},
|
|
4039
|
+
"required": [
|
|
4040
|
+
"staff"
|
|
4041
|
+
],
|
|
4042
|
+
"additionalProperties": false
|
|
4043
|
+
},
|
|
4044
|
+
"AgentEvalTextMatcher": {
|
|
4045
|
+
"description": "What a reply's text is matched against: a string, found anywhere in it, ignoring case; a regular expression (`pattern`, with `flags`); or a `rubric`, which a judge model decides.",
|
|
4046
|
+
"oneOf": [
|
|
4047
|
+
{
|
|
4048
|
+
"type": "string",
|
|
4049
|
+
"minLength": 1
|
|
4050
|
+
},
|
|
4051
|
+
{
|
|
4052
|
+
"type": "object",
|
|
4053
|
+
"properties": {
|
|
4054
|
+
"pattern": {
|
|
4055
|
+
"type": "string",
|
|
4056
|
+
"minLength": 1
|
|
4057
|
+
},
|
|
4058
|
+
"flags": {
|
|
4059
|
+
"description": "Regular-expression flags among `i`, `m`, `s` and `u`.",
|
|
4060
|
+
"type": "string",
|
|
4061
|
+
"pattern": "^[imsu]*$"
|
|
4062
|
+
}
|
|
4063
|
+
},
|
|
4064
|
+
"required": [
|
|
4065
|
+
"pattern"
|
|
4066
|
+
],
|
|
4067
|
+
"additionalProperties": false
|
|
4068
|
+
},
|
|
4069
|
+
{
|
|
4070
|
+
"type": "object",
|
|
4071
|
+
"properties": {
|
|
4072
|
+
"rubric": {
|
|
4073
|
+
"description": "What the reply must do, in a sentence a judge reads.",
|
|
4074
|
+
"type": "string",
|
|
4075
|
+
"minLength": 1
|
|
4076
|
+
}
|
|
4077
|
+
},
|
|
4078
|
+
"required": [
|
|
4079
|
+
"rubric"
|
|
4080
|
+
],
|
|
4081
|
+
"additionalProperties": false
|
|
4082
|
+
}
|
|
4083
|
+
]
|
|
4084
|
+
},
|
|
4085
|
+
"AgentEvalToolCall": {
|
|
4086
|
+
"description": "A tool the agent called: its name, and arguments its call holds (a subset: every key given, with an equal value; nested objects as subsets too).",
|
|
4087
|
+
"type": "object",
|
|
4088
|
+
"properties": {
|
|
4089
|
+
"name": {
|
|
4090
|
+
"type": "string",
|
|
4091
|
+
"minLength": 1
|
|
4092
|
+
},
|
|
4093
|
+
"args": {
|
|
4094
|
+
"type": "object",
|
|
4095
|
+
"additionalProperties": true
|
|
4096
|
+
}
|
|
4097
|
+
},
|
|
4098
|
+
"required": [
|
|
4099
|
+
"name"
|
|
4100
|
+
],
|
|
4101
|
+
"additionalProperties": false
|
|
4102
|
+
},
|
|
4103
|
+
"AgentEvalApprovalExpectation": {
|
|
4104
|
+
"description": "The turn stopped at a call that needs the customer's approval, with a readback present.",
|
|
4105
|
+
"type": "object",
|
|
4106
|
+
"properties": {
|
|
4107
|
+
"tool": {
|
|
4108
|
+
"type": "string",
|
|
4109
|
+
"minLength": 1
|
|
4110
|
+
},
|
|
4111
|
+
"args": {
|
|
4112
|
+
"description": "A subset of the call's arguments.",
|
|
4113
|
+
"type": "object",
|
|
4114
|
+
"additionalProperties": true
|
|
4115
|
+
},
|
|
4116
|
+
"readback": {
|
|
4117
|
+
"description": "What the readback must say.",
|
|
4118
|
+
"$ref": "#/$defs/AgentEvalTextMatcher"
|
|
4119
|
+
}
|
|
4120
|
+
},
|
|
4121
|
+
"additionalProperties": false
|
|
4122
|
+
},
|
|
4123
|
+
"AgentEvalExpectation": {
|
|
4124
|
+
"description": "What must hold after a turn. Every field given must hold.",
|
|
4125
|
+
"type": "object",
|
|
4126
|
+
"properties": {
|
|
4127
|
+
"says": {
|
|
4128
|
+
"description": "Each must match the reply.",
|
|
4129
|
+
"type": "array",
|
|
4130
|
+
"items": {
|
|
4131
|
+
"$ref": "#/$defs/AgentEvalTextMatcher"
|
|
4132
|
+
}
|
|
4133
|
+
},
|
|
4134
|
+
"mustNotSay": {
|
|
4135
|
+
"description": "None may match the reply.",
|
|
4136
|
+
"type": "array",
|
|
4137
|
+
"items": {
|
|
4138
|
+
"$ref": "#/$defs/AgentEvalTextMatcher"
|
|
4139
|
+
}
|
|
4140
|
+
},
|
|
4141
|
+
"toolCalled": {
|
|
4142
|
+
"description": "Each was called, with these arguments.",
|
|
4143
|
+
"type": "array",
|
|
4144
|
+
"items": {
|
|
4145
|
+
"$ref": "#/$defs/AgentEvalToolCall"
|
|
4146
|
+
}
|
|
4147
|
+
},
|
|
4148
|
+
"toolNotCalled": {
|
|
4149
|
+
"description": "None of these was called; `*` means no tool at all.",
|
|
4150
|
+
"type": "array",
|
|
4151
|
+
"items": {
|
|
4152
|
+
"type": "string",
|
|
4153
|
+
"minLength": 1
|
|
4154
|
+
}
|
|
4155
|
+
},
|
|
4156
|
+
"approvalRequested": {
|
|
4157
|
+
"description": "The turn stopped for the customer's approval of this call; `false`: it did not stop for any.",
|
|
4158
|
+
"oneOf": [
|
|
4159
|
+
{
|
|
4160
|
+
"const": false
|
|
4161
|
+
},
|
|
4162
|
+
{
|
|
4163
|
+
"$ref": "#/$defs/AgentEvalApprovalExpectation"
|
|
4164
|
+
}
|
|
4165
|
+
]
|
|
4166
|
+
},
|
|
4167
|
+
"refusal": {
|
|
4168
|
+
"description": "The reply declines: `true` for the usual phrasing of a refusal (can't, cannot, unable, not able, won't, not allowed), or a matcher for the agent's own words.",
|
|
4169
|
+
"oneOf": [
|
|
4170
|
+
{
|
|
4171
|
+
"const": true
|
|
4172
|
+
},
|
|
4173
|
+
{
|
|
4174
|
+
"$ref": "#/$defs/AgentEvalTextMatcher"
|
|
4175
|
+
}
|
|
4176
|
+
]
|
|
4177
|
+
},
|
|
4178
|
+
"doesNotStore": {
|
|
4179
|
+
"description": "None of these appears in anything the turn stored: its text, its tool calls' arguments, its tool results.",
|
|
4180
|
+
"type": "array",
|
|
4181
|
+
"items": {
|
|
4182
|
+
"$ref": "#/$defs/AgentEvalTextMatcher"
|
|
4183
|
+
}
|
|
4184
|
+
},
|
|
4185
|
+
"held": {
|
|
4186
|
+
"description": "`true`: the turn ran no model call, because a person held the conversation.",
|
|
4187
|
+
"type": "boolean"
|
|
4188
|
+
}
|
|
4189
|
+
},
|
|
4190
|
+
"additionalProperties": false
|
|
4191
|
+
},
|
|
4192
|
+
"AgentEvalExpectationsByChannel": {
|
|
4193
|
+
"description": "What must also hold on one channel, by its name.",
|
|
4194
|
+
"type": "object",
|
|
4195
|
+
"additionalProperties": {
|
|
4196
|
+
"$ref": "#/$defs/AgentEvalExpectation"
|
|
4197
|
+
}
|
|
4198
|
+
},
|
|
4199
|
+
"AgentEvalStubCase": {
|
|
4200
|
+
"description": "What a tool returns when it is called with arguments that hold `when` (a subset; absent: any call).",
|
|
4201
|
+
"type": "object",
|
|
4202
|
+
"properties": {
|
|
4203
|
+
"when": {
|
|
4204
|
+
"type": "object",
|
|
4205
|
+
"additionalProperties": true
|
|
4206
|
+
},
|
|
4207
|
+
"result": {
|
|
4208
|
+
"type": "object",
|
|
4209
|
+
"properties": {
|
|
4210
|
+
"success": {
|
|
4211
|
+
"type": "boolean"
|
|
4212
|
+
},
|
|
4213
|
+
"data": {},
|
|
4214
|
+
"error": {
|
|
4215
|
+
"type": "string"
|
|
4216
|
+
}
|
|
4217
|
+
},
|
|
4218
|
+
"required": [
|
|
4219
|
+
"success"
|
|
4220
|
+
],
|
|
4221
|
+
"additionalProperties": false
|
|
4222
|
+
}
|
|
4223
|
+
},
|
|
4224
|
+
"required": [
|
|
4225
|
+
"result"
|
|
4226
|
+
],
|
|
4227
|
+
"additionalProperties": false
|
|
4228
|
+
},
|
|
4229
|
+
"AgentEvalStubs": {
|
|
4230
|
+
"description": "What each tool returns, by tool name: its cases in order, the first that matches the call wins. A call to a tool with no matching case fails the scenario: an eval never reaches a real backend.",
|
|
4231
|
+
"type": "object",
|
|
4232
|
+
"additionalProperties": {
|
|
4233
|
+
"type": "array",
|
|
4234
|
+
"items": {
|
|
4235
|
+
"$ref": "#/$defs/AgentEvalStubCase"
|
|
4236
|
+
},
|
|
4237
|
+
"minItems": 1
|
|
4238
|
+
}
|
|
4239
|
+
}
|
|
4240
|
+
}
|
|
4241
|
+
},
|
|
3402
4242
|
};
|
|
3403
4243
|
/**
|
|
3404
4244
|
* Each generated type, by name, and the schema it is generated from (`file`, or
|
|
@@ -3494,5 +4334,35 @@ export const CONTRACT_TYPES = {
|
|
|
3494
4334
|
EventRole: 'event-declarations.json#/$defs/EventRole',
|
|
3495
4335
|
FailureReason: 'event-declarations.json#/$defs/FailureReason',
|
|
3496
4336
|
EventDeclaration: 'event-declarations.json#/$defs/EventDeclaration',
|
|
4337
|
+
StaffSpeaker: 'conversation-takeover.json#/$defs/StaffSpeaker',
|
|
4338
|
+
ConversationHold: 'conversation-takeover.json#/$defs/ConversationHold',
|
|
4339
|
+
TakeoverChange: 'conversation-takeover.json#/$defs/TakeoverChange',
|
|
4340
|
+
HandBackCause: 'conversation-takeover.json#/$defs/HandBackCause',
|
|
4341
|
+
ConversationMessageRole: 'conversation-takeover.json#/$defs/ConversationMessageRole',
|
|
4342
|
+
ConversationMessage: 'conversation-takeover.json#/$defs/ConversationMessage',
|
|
4343
|
+
ConversationRooms: 'conversation-takeover.json#/$defs/ConversationRooms',
|
|
4344
|
+
TakeOverRequest: 'conversation-takeover.json#/$defs/TakeOverRequest',
|
|
4345
|
+
TakeOverResult: 'conversation-takeover.json#/$defs/TakeOverResult',
|
|
4346
|
+
HandBackRequest: 'conversation-takeover.json#/$defs/HandBackRequest',
|
|
4347
|
+
HandBackResult: 'conversation-takeover.json#/$defs/HandBackResult',
|
|
4348
|
+
AnnounceMessageRequest: 'conversation-takeover.json#/$defs/AnnounceMessageRequest',
|
|
4349
|
+
AnnounceMessageResult: 'conversation-takeover.json#/$defs/AnnounceMessageResult',
|
|
4350
|
+
ConversationTakenOverEvent: 'conversation-takeover.json#/$defs/ConversationTakenOverEvent',
|
|
4351
|
+
ConversationHandedBackEvent: 'conversation-takeover.json#/$defs/ConversationHandedBackEvent',
|
|
4352
|
+
ConversationMessageEvent: 'conversation-takeover.json#/$defs/ConversationMessageEvent',
|
|
4353
|
+
AgentEvalSuite: 'agent-evals.json',
|
|
4354
|
+
AgentEvalChannelList: 'agent-evals.json#/$defs/AgentEvalChannelList',
|
|
4355
|
+
AgentEvalScenario: 'agent-evals.json#/$defs/AgentEvalScenario',
|
|
4356
|
+
AgentEvalTurn: 'agent-evals.json#/$defs/AgentEvalTurn',
|
|
4357
|
+
AgentEvalUserTurn: 'agent-evals.json#/$defs/AgentEvalUserTurn',
|
|
4358
|
+
AgentEvalApprovalTurn: 'agent-evals.json#/$defs/AgentEvalApprovalTurn',
|
|
4359
|
+
AgentEvalStaffTurn: 'agent-evals.json#/$defs/AgentEvalStaffTurn',
|
|
4360
|
+
AgentEvalTextMatcher: 'agent-evals.json#/$defs/AgentEvalTextMatcher',
|
|
4361
|
+
AgentEvalToolCall: 'agent-evals.json#/$defs/AgentEvalToolCall',
|
|
4362
|
+
AgentEvalApprovalExpectation: 'agent-evals.json#/$defs/AgentEvalApprovalExpectation',
|
|
4363
|
+
AgentEvalExpectation: 'agent-evals.json#/$defs/AgentEvalExpectation',
|
|
4364
|
+
AgentEvalExpectationsByChannel: 'agent-evals.json#/$defs/AgentEvalExpectationsByChannel',
|
|
4365
|
+
AgentEvalStubCase: 'agent-evals.json#/$defs/AgentEvalStubCase',
|
|
4366
|
+
AgentEvalStubs: 'agent-evals.json#/$defs/AgentEvalStubs',
|
|
3497
4367
|
};
|
|
3498
4368
|
//# sourceMappingURL=schemas.js.map
|