@breign/client 1.0.156 → 1.0.158

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.
Files changed (66) hide show
  1. package/dist/apis/ConversationsApi.d.ts +28 -1
  2. package/dist/apis/ConversationsApi.js +63 -0
  3. package/dist/apis/McpApi.d.ts +58 -0
  4. package/dist/apis/McpApi.js +154 -0
  5. package/dist/apis/MetricsApi.d.ts +16 -1
  6. package/dist/apis/MetricsApi.js +35 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/models/AgentChatOverviewEntryUio.d.ts +6 -0
  10. package/dist/models/AgentChatOverviewEntryUio.js +2 -0
  11. package/dist/models/AgentHumanEscalationConfigurationUio.d.ts +44 -0
  12. package/dist/models/AgentHumanEscalationConfigurationUio.js +52 -0
  13. package/dist/models/AgentMcpExposureConfigurationUio.d.ts +32 -0
  14. package/dist/models/AgentMcpExposureConfigurationUio.js +48 -0
  15. package/dist/models/AgentPatchUio.d.ts +17 -3
  16. package/dist/models/AgentPatchUio.js +9 -3
  17. package/dist/models/AgentUio.d.ts +14 -0
  18. package/dist/models/AgentUio.js +6 -0
  19. package/dist/models/ChatMessageUio.d.ts +7 -0
  20. package/dist/models/ChatMessageUio.js +3 -0
  21. package/dist/models/ConversationHumanRequestRequestedByUio.d.ts +46 -0
  22. package/dist/models/ConversationHumanRequestRequestedByUio.js +60 -0
  23. package/dist/models/ConversationHumanRequestUio.d.ts +109 -0
  24. package/dist/models/ConversationHumanRequestUio.js +93 -0
  25. package/dist/models/HumanRequestAnswerResultUio.d.ts +40 -0
  26. package/dist/models/HumanRequestAnswerResultUio.js +58 -0
  27. package/dist/models/HumanRequestAnswerUio.d.ts +38 -0
  28. package/dist/models/HumanRequestAnswerUio.js +50 -0
  29. package/dist/models/HumanRequestSummaryRequestedByUio.d.ts +46 -0
  30. package/dist/models/HumanRequestSummaryRequestedByUio.js +58 -0
  31. package/dist/models/HumanRequestSummaryUio.d.ts +93 -0
  32. package/dist/models/HumanRequestSummaryUio.js +81 -0
  33. package/dist/models/McpAgentListAgentsInnerUio.d.ts +50 -0
  34. package/dist/models/McpAgentListAgentsInnerUio.js +58 -0
  35. package/dist/models/McpAgentListUio.d.ts +33 -0
  36. package/dist/models/McpAgentListUio.js +51 -0
  37. package/dist/models/McpCallToolResultStructuredContentUio.d.ts +23 -0
  38. package/dist/models/McpCallToolResultStructuredContentUio.js +57 -0
  39. package/dist/models/McpCallToolResultUio.d.ts +47 -0
  40. package/dist/models/McpCallToolResultUio.js +56 -0
  41. package/dist/models/McpJsonRpcErrorUio.d.ts +38 -0
  42. package/dist/models/McpJsonRpcErrorUio.js +54 -0
  43. package/dist/models/McpJsonRpcRequestIdUio.d.ts +21 -0
  44. package/dist/models/McpJsonRpcRequestIdUio.js +37 -0
  45. package/dist/models/McpJsonRpcRequestUio.d.ts +60 -0
  46. package/dist/models/McpJsonRpcRequestUio.js +66 -0
  47. package/dist/models/McpJsonRpcResponseIdUio.d.ts +21 -0
  48. package/dist/models/McpJsonRpcResponseIdUio.js +37 -0
  49. package/dist/models/McpJsonRpcResponseUio.d.ts +60 -0
  50. package/dist/models/McpJsonRpcResponseUio.js +66 -0
  51. package/dist/models/McpTextContentUio.d.ts +45 -0
  52. package/dist/models/McpTextContentUio.js +61 -0
  53. package/dist/models/McpTicketViewUio.d.ts +114 -0
  54. package/dist/models/McpTicketViewUio.js +90 -0
  55. package/dist/models/ModelConsumptionItemUio.d.ts +81 -0
  56. package/dist/models/ModelConsumptionItemUio.js +83 -0
  57. package/dist/models/ModelConsumptionSliceUio.d.ts +78 -0
  58. package/dist/models/ModelConsumptionSliceUio.js +84 -0
  59. package/dist/models/OrganizationModelConsumptionTotalUio.d.ts +56 -0
  60. package/dist/models/OrganizationModelConsumptionTotalUio.js +66 -0
  61. package/dist/models/OrganizationModelConsumptionUio.d.ts +40 -0
  62. package/dist/models/OrganizationModelConsumptionUio.js +56 -0
  63. package/dist/models/index.d.ts +23 -0
  64. package/dist/models/index.js +23 -0
  65. package/dist/openapi.json +797 -10
  66. package/package.json +1 -1
package/dist/openapi.json CHANGED
@@ -81,6 +81,9 @@
81
81
  }, {
82
82
  "description" : "Super-admin only endpoints",
83
83
  "name" : "admin"
84
+ }, {
85
+ "description" : "MCP server for local agents (Claude Code, Pi, Hermes…)",
86
+ "name" : "mcp"
84
87
  } ],
85
88
  "paths" : {
86
89
  "/health" : {
@@ -5429,6 +5432,209 @@
5429
5432
  "tags" : [ "conversations" ]
5430
5433
  }
5431
5434
  },
5435
+ "/organizations/{organizationId}/chat/human-requests" : {
5436
+ "get" : {
5437
+ "description" : "Questions posées par des agents (outil Human_ask) depuis des conversations de tâche et qui attendent une réponse de l'utilisateur courant. Les questions échues sont expirées au passage et n'apparaissent pas.",
5438
+ "operationId" : "listPendingHumanRequests",
5439
+ "parameters" : [ {
5440
+ "description" : "ID of the organization",
5441
+ "in" : "path",
5442
+ "name" : "organizationId",
5443
+ "required" : true,
5444
+ "schema" : {
5445
+ "type" : "string"
5446
+ }
5447
+ } ],
5448
+ "responses" : {
5449
+ "200" : {
5450
+ "content" : {
5451
+ "application/json" : {
5452
+ "schema" : {
5453
+ "items" : {
5454
+ "$ref" : "#/components/schemas/HumanRequestSummary"
5455
+ },
5456
+ "type" : "array"
5457
+ }
5458
+ }
5459
+ },
5460
+ "description" : "Pending questions"
5461
+ },
5462
+ "401" : {
5463
+ "description" : "Unauthenticated"
5464
+ },
5465
+ "403" : {
5466
+ "description" : "Forbidden — the caller is not part of the organization"
5467
+ }
5468
+ },
5469
+ "summary" : "List the questions waiting for the current user",
5470
+ "tags" : [ "conversations" ]
5471
+ }
5472
+ },
5473
+ "/human-requests/{callId}/answer" : {
5474
+ "post" : {
5475
+ "description" : "Répond (ou décline) une question posée par un agent via Human_ask. Termine l'appel différé et relance le tour de la tâche en arrière-plan. Seul l'humain à qui la question a été adressée peut y répondre.",
5476
+ "operationId" : "answerHumanRequest",
5477
+ "parameters" : [ {
5478
+ "in" : "path",
5479
+ "name" : "callId",
5480
+ "required" : true,
5481
+ "schema" : {
5482
+ "type" : "string"
5483
+ }
5484
+ } ],
5485
+ "requestBody" : {
5486
+ "content" : {
5487
+ "application/json" : {
5488
+ "schema" : {
5489
+ "$ref" : "#/components/schemas/HumanRequestAnswer"
5490
+ }
5491
+ }
5492
+ },
5493
+ "required" : true
5494
+ },
5495
+ "responses" : {
5496
+ "202" : {
5497
+ "content" : {
5498
+ "application/json" : {
5499
+ "schema" : {
5500
+ "$ref" : "#/components/schemas/HumanRequestAnswerResult"
5501
+ }
5502
+ }
5503
+ },
5504
+ "description" : "Answer recorded, the task resumes"
5505
+ },
5506
+ "400" : {
5507
+ "description" : "Neither an answer nor a decline"
5508
+ },
5509
+ "401" : {
5510
+ "description" : "Unauthenticated"
5511
+ },
5512
+ "404" : {
5513
+ "description" : "No such question for this user"
5514
+ },
5515
+ "409" : {
5516
+ "description" : "Already answered"
5517
+ },
5518
+ "410" : {
5519
+ "description" : "Expired"
5520
+ }
5521
+ },
5522
+ "summary" : "Answer a question asked by an agent",
5523
+ "tags" : [ "conversations" ]
5524
+ }
5525
+ },
5526
+ "/organizations/{organizationId}/mcp" : {
5527
+ "delete" : {
5528
+ "description" : "Aucune session à clore : le transport est sans état.",
5529
+ "operationId" : "deleteMcpSession",
5530
+ "parameters" : [ {
5531
+ "description" : "ID of the organization",
5532
+ "in" : "path",
5533
+ "name" : "organizationId",
5534
+ "required" : true,
5535
+ "schema" : {
5536
+ "type" : "string"
5537
+ }
5538
+ } ],
5539
+ "responses" : {
5540
+ "405" : {
5541
+ "content" : {
5542
+ "application/json" : {
5543
+ "schema" : {
5544
+ "$ref" : "#/components/schemas/McpJsonRpcResponse"
5545
+ }
5546
+ }
5547
+ },
5548
+ "description" : "Method not allowed"
5549
+ }
5550
+ },
5551
+ "summary" : "Not supported (stateless MCP server)",
5552
+ "tags" : [ "mcp" ]
5553
+ },
5554
+ "get" : {
5555
+ "description" : "Pas de flux SSE côté serveur : le transport est sans état.",
5556
+ "operationId" : "getMcpStream",
5557
+ "parameters" : [ {
5558
+ "description" : "ID of the organization",
5559
+ "in" : "path",
5560
+ "name" : "organizationId",
5561
+ "required" : true,
5562
+ "schema" : {
5563
+ "type" : "string"
5564
+ }
5565
+ } ],
5566
+ "responses" : {
5567
+ "405" : {
5568
+ "content" : {
5569
+ "application/json" : {
5570
+ "schema" : {
5571
+ "$ref" : "#/components/schemas/McpJsonRpcResponse"
5572
+ }
5573
+ }
5574
+ },
5575
+ "description" : "Method not allowed"
5576
+ }
5577
+ },
5578
+ "summary" : "Not supported (stateless MCP server)",
5579
+ "tags" : [ "mcp" ]
5580
+ },
5581
+ "post" : {
5582
+ "description" : "Serveur MCP (Model Context Protocol, transport Streamable HTTP, sans état) par lequel les agents locaux — Claude Code, Pi, Hermes… — interrogent les agents Breign de l'organisation.\n\nAuthentification par clé API personnelle (`x-api-key` ou `Authorization: Bearer ai-…`) ; les credentials d'app et la clé maître sans `x-user-id` sont refusés. Seuls les agents dont `mcpExposureConfiguration.enabled` est vrai sont joignables.\n\nOutils exposés :\n- `list_agents` — agents joignables, avec leur rôle et leur description.\n- `ask_agent` `{ agentId, message, conversationId?, waitSeconds? }` — pose une question ;\n attend la réponse jusqu'à `waitSeconds` (25 s par défaut, 50 s max), sinon rend un ticket.\n\n- `wait_for_reply` `{ ticket, timeoutSeconds? }` — attend la réponse d'un ticket (45 s par\n défaut, 50 s max).\n\n\nChaque question vit dans une conversation de tâche au nom du propriétaire de la clé. L'agent interrogé peut consulter d'autres agents ou poser une question à un humain (outil Human_ask) : le statut vaut alors `waiting_human`, parfois pendant des heures.\n\nConfiguration d'un client, par exemple Claude Code : `claude mcp add --transport http breign https://<api>/organizations/<organizationId>/mcp --header \"Authorization: Bearer ai-…\"`. Le client doit accepter `application/json` et `text/event-stream` (header `Accept`).",
5583
+ "operationId" : "handleMcpRequest",
5584
+ "parameters" : [ {
5585
+ "description" : "ID of the organization",
5586
+ "in" : "path",
5587
+ "name" : "organizationId",
5588
+ "required" : true,
5589
+ "schema" : {
5590
+ "type" : "string"
5591
+ }
5592
+ } ],
5593
+ "requestBody" : {
5594
+ "content" : {
5595
+ "application/json" : {
5596
+ "schema" : {
5597
+ "$ref" : "#/components/schemas/McpJsonRpcRequest"
5598
+ }
5599
+ }
5600
+ },
5601
+ "required" : true
5602
+ },
5603
+ "responses" : {
5604
+ "200" : {
5605
+ "content" : {
5606
+ "application/json" : {
5607
+ "schema" : {
5608
+ "$ref" : "#/components/schemas/McpJsonRpcResponse"
5609
+ }
5610
+ }
5611
+ },
5612
+ "description" : "Réponse JSON-RPC"
5613
+ },
5614
+ "202" : {
5615
+ "description" : "Notification acceptée, sans corps"
5616
+ },
5617
+ "401" : {
5618
+ "content" : {
5619
+ "application/json" : {
5620
+ "schema" : {
5621
+ "$ref" : "#/components/schemas/McpJsonRpcResponse"
5622
+ }
5623
+ }
5624
+ },
5625
+ "description" : "Clé API personnelle requise"
5626
+ },
5627
+ "403" : {
5628
+ "description" : "Forbidden — the caller is not part of the organization"
5629
+ },
5630
+ "404" : {
5631
+ "description" : "Serveur MCP désactivé sur ce déploiement"
5632
+ }
5633
+ },
5634
+ "summary" : "MCP server for local agents",
5635
+ "tags" : [ "mcp" ]
5636
+ }
5637
+ },
5432
5638
  "/conversations/{conversationId}/read" : {
5433
5639
  "post" : {
5434
5640
  "description" : "Positionne la marque de lecture de l'utilisateur sur la conversation.",
@@ -7293,6 +7499,58 @@
7293
7499
  "tags" : [ "metrics" ]
7294
7500
  }
7295
7501
  },
7502
+ "/metrics/organizations/{organizationId}/model-consumption" : {
7503
+ "get" : {
7504
+ "description" : "Tokens consumed by model and provider, split between agents, organization costs without an agent, direct AI Gateway calls, and users. Restricted to organization administrators.",
7505
+ "operationId" : "getMetricsOrganizationModelConsumption",
7506
+ "parameters" : [ {
7507
+ "description" : "ID of the organization",
7508
+ "in" : "path",
7509
+ "name" : "organizationId",
7510
+ "required" : true,
7511
+ "schema" : {
7512
+ "type" : "string"
7513
+ }
7514
+ }, {
7515
+ "description" : "Start date for metrics (ISO format)",
7516
+ "in" : "query",
7517
+ "name" : "startDate",
7518
+ "schema" : {
7519
+ "type" : "string"
7520
+ }
7521
+ }, {
7522
+ "description" : "End date for metrics (ISO format)",
7523
+ "in" : "query",
7524
+ "name" : "endDate",
7525
+ "schema" : {
7526
+ "type" : "string"
7527
+ }
7528
+ } ],
7529
+ "responses" : {
7530
+ "200" : {
7531
+ "content" : {
7532
+ "application/json" : {
7533
+ "schema" : {
7534
+ "$ref" : "#/components/schemas/OrganizationModelConsumption"
7535
+ }
7536
+ }
7537
+ },
7538
+ "description" : "Model consumption retrieved successfully"
7539
+ },
7540
+ "401" : {
7541
+ "description" : "Unauthorized"
7542
+ },
7543
+ "403" : {
7544
+ "description" : "Forbidden"
7545
+ },
7546
+ "500" : {
7547
+ "description" : "Server error"
7548
+ }
7549
+ },
7550
+ "summary" : "Get model consumption for an organization",
7551
+ "tags" : [ "metrics" ]
7552
+ }
7553
+ },
7296
7554
  "/agents/{agentId}/guardians" : {
7297
7555
  "get" : {
7298
7556
  "operationId" : "getGuardiansForAgent",
@@ -16433,6 +16691,18 @@
16433
16691
  } ],
16434
16692
  "nullable" : true
16435
16693
  },
16694
+ "mcpExposureConfiguration" : {
16695
+ "allOf" : [ {
16696
+ "$ref" : "#/components/schemas/AgentMcpExposureConfiguration"
16697
+ } ],
16698
+ "nullable" : true
16699
+ },
16700
+ "humanEscalationConfiguration" : {
16701
+ "allOf" : [ {
16702
+ "$ref" : "#/components/schemas/AgentHumanEscalationConfiguration"
16703
+ } ],
16704
+ "nullable" : true
16705
+ },
16436
16706
  "codeModeConfiguration" : {
16437
16707
  "allOf" : [ {
16438
16708
  "$ref" : "#/components/schemas/AgentCodeModeConfiguration"
@@ -16663,6 +16933,40 @@
16663
16933
  },
16664
16934
  "type" : "object"
16665
16935
  },
16936
+ "AgentMcpExposureConfiguration" : {
16937
+ "description" : "Reachability from local agents (Claude Code, Pi, Hermes…) through Breign's MCP server. Opt-in: an agent nobody exposed is invisible to list_agents and refuses ask_agent.",
16938
+ "properties" : {
16939
+ "enabled" : {
16940
+ "description" : "Makes this agent reachable from local agents.",
16941
+ "type" : "boolean"
16942
+ }
16943
+ },
16944
+ "type" : "object"
16945
+ },
16946
+ "AgentHumanEscalationConfiguration" : {
16947
+ "description" : "Per-agent activation of the Human_ask tool, offered only in task conversations (a local agent or another agent asking). The question goes to the first valid referent; without one, to the user who owns the task — the person who connected the local agent.",
16948
+ "properties" : {
16949
+ "enabled" : {
16950
+ "description" : "Enables the Human_ask tool for this agent.",
16951
+ "type" : "boolean"
16952
+ },
16953
+ "referentUserIds" : {
16954
+ "description" : "Organisation members who answer this agent's questions, in order of preference.",
16955
+ "items" : {
16956
+ "type" : "string"
16957
+ },
16958
+ "maxItems" : 5,
16959
+ "type" : "array"
16960
+ },
16961
+ "questionTtlHours" : {
16962
+ "description" : "How long a question stays answerable. Past it, the agent resumes on its own assumption.",
16963
+ "maximum" : 168,
16964
+ "minimum" : 1,
16965
+ "type" : "integer"
16966
+ }
16967
+ },
16968
+ "type" : "object"
16969
+ },
16666
16970
  "AgentCodeModeConfiguration" : {
16667
16971
  "description" : "Per-agent activation of code mode: the model writes a JavaScript/TypeScript program that calls the agent's tools inside a sandbox, instead of one tool call per round trip. Opt-in, and narrower than it looks — only the tools declared code-mode callable server-side are reachable from a program. The server configuration can only narrow this.",
16668
16972
  "properties" : {
@@ -16865,6 +17169,18 @@
16865
17169
  } ],
16866
17170
  "nullable" : true
16867
17171
  },
17172
+ "mcpExposureConfiguration" : {
17173
+ "allOf" : [ {
17174
+ "$ref" : "#/components/schemas/AgentMcpExposureConfiguration"
17175
+ } ],
17176
+ "nullable" : true
17177
+ },
17178
+ "humanEscalationConfiguration" : {
17179
+ "allOf" : [ {
17180
+ "$ref" : "#/components/schemas/AgentHumanEscalationConfiguration"
17181
+ } ],
17182
+ "nullable" : true
17183
+ },
16868
17184
  "codeModeConfiguration" : {
16869
17185
  "allOf" : [ {
16870
17186
  "$ref" : "#/components/schemas/AgentCodeModeConfiguration"
@@ -17888,6 +18204,9 @@
17888
18204
  },
17889
18205
  "type" : "array"
17890
18206
  },
18207
+ "humanRequest" : {
18208
+ "$ref" : "#/components/schemas/ConversationHumanRequest"
18209
+ },
17891
18210
  "suggestions" : {
17892
18211
  "items" : {
17893
18212
  "$ref" : "#/components/schemas/Suggestion"
@@ -18038,20 +18357,71 @@
18038
18357
  "title" : "ConversationMessageApproval",
18039
18358
  "type" : "object"
18040
18359
  },
18041
- "Suggestion" : {
18360
+ "ConversationHumanRequest" : {
18361
+ "description" : "A question an agent asks a human from a task conversation (Human_ask tool). Carried by a mirror message in the human's chat conversation with that agent, which is where they see and answer it. The task stays suspended on the pending call callId until the answer resumes it.",
18042
18362
  "properties" : {
18043
- "id" : {
18363
+ "callId" : {
18364
+ "description" : "The pending tool call the answer resolves.",
18044
18365
  "type" : "string"
18045
18366
  },
18046
- "text" : {
18367
+ "taskConversationId" : {
18047
18368
  "type" : "string"
18048
- }
18049
- },
18050
- "required" : [ "id", "text" ],
18051
- "type" : "object"
18052
- },
18053
- "FileAttachment" : {
18054
- "properties" : {
18369
+ },
18370
+ "taskMessageId" : {
18371
+ "type" : "string"
18372
+ },
18373
+ "question" : {
18374
+ "type" : "string"
18375
+ },
18376
+ "options" : {
18377
+ "items" : {
18378
+ "type" : "string"
18379
+ },
18380
+ "type" : "array"
18381
+ },
18382
+ "context" : {
18383
+ "description" : "What is blocked and why, as the agent put it.",
18384
+ "type" : "string"
18385
+ },
18386
+ "requestedBy" : {
18387
+ "$ref" : "#/components/schemas/ConversationHumanRequest_requestedBy"
18388
+ },
18389
+ "status" : {
18390
+ "enum" : [ "pending", "answered", "declined", "expired" ],
18391
+ "type" : "string"
18392
+ },
18393
+ "answer" : {
18394
+ "type" : "string"
18395
+ },
18396
+ "answeredBy" : {
18397
+ "description" : "Name or email of the person who answered, as it stood when they answered.",
18398
+ "type" : "string"
18399
+ },
18400
+ "answeredAt" : {
18401
+ "type" : "string"
18402
+ },
18403
+ "expiresAt" : {
18404
+ "type" : "string"
18405
+ }
18406
+ },
18407
+ "required" : [ "callId", "question", "requestedBy", "status", "taskConversationId", "taskMessageId" ],
18408
+ "title" : "ConversationHumanRequest",
18409
+ "type" : "object"
18410
+ },
18411
+ "Suggestion" : {
18412
+ "properties" : {
18413
+ "id" : {
18414
+ "type" : "string"
18415
+ },
18416
+ "text" : {
18417
+ "type" : "string"
18418
+ }
18419
+ },
18420
+ "required" : [ "id", "text" ],
18421
+ "type" : "object"
18422
+ },
18423
+ "FileAttachment" : {
18424
+ "properties" : {
18055
18425
  "type" : {
18056
18426
  "$ref" : "#/components/schemas/AttachmentType"
18057
18427
  },
@@ -19755,11 +20125,252 @@
19755
20125
  "isGenerating" : {
19756
20126
  "description" : "Vrai tant qu'une réponse est en cours de génération",
19757
20127
  "type" : "boolean"
20128
+ },
20129
+ "pendingHumanRequests" : {
20130
+ "description" : "Questions de cet agent qui attendent une réponse de l'utilisateur courant (outil Human_ask), toutes tâches confondues.",
20131
+ "type" : "integer"
19758
20132
  }
19759
20133
  },
19760
20134
  "required" : [ "agentId", "conversationId", "isGenerating", "unreadCount" ],
19761
20135
  "type" : "object"
19762
20136
  },
20137
+ "HumanRequestSummary" : {
20138
+ "description" : "Une question en attente de réponse de l'utilisateur courant.",
20139
+ "properties" : {
20140
+ "callId" : {
20141
+ "type" : "string"
20142
+ },
20143
+ "agentId" : {
20144
+ "format" : "uuid",
20145
+ "type" : "string"
20146
+ },
20147
+ "humanConversationId" : {
20148
+ "description" : "Conversation de l'utilisateur avec l'agent, où la question est affichée.",
20149
+ "format" : "uuid",
20150
+ "type" : "string"
20151
+ },
20152
+ "humanMessageId" : {
20153
+ "type" : "string"
20154
+ },
20155
+ "taskConversationId" : {
20156
+ "format" : "uuid",
20157
+ "type" : "string"
20158
+ },
20159
+ "taskMessageId" : {
20160
+ "type" : "string"
20161
+ },
20162
+ "question" : {
20163
+ "type" : "string"
20164
+ },
20165
+ "options" : {
20166
+ "items" : {
20167
+ "type" : "string"
20168
+ },
20169
+ "type" : "array"
20170
+ },
20171
+ "requestedBy" : {
20172
+ "$ref" : "#/components/schemas/HumanRequestSummary_requestedBy"
20173
+ },
20174
+ "expiresAt" : {
20175
+ "nullable" : true,
20176
+ "type" : "string"
20177
+ },
20178
+ "createdAt" : {
20179
+ "type" : "string"
20180
+ }
20181
+ },
20182
+ "required" : [ "agentId", "callId", "humanConversationId", "question", "taskConversationId", "taskMessageId" ],
20183
+ "type" : "object"
20184
+ },
20185
+ "HumanRequestAnswer" : {
20186
+ "description" : "Réponse à une question. Soit une réponse non vide, soit decline à vrai : l'agent repart alors sur sa meilleure hypothèse.",
20187
+ "properties" : {
20188
+ "answer" : {
20189
+ "type" : "string"
20190
+ },
20191
+ "decline" : {
20192
+ "type" : "boolean"
20193
+ }
20194
+ },
20195
+ "type" : "object"
20196
+ },
20197
+ "HumanRequestAnswerResult" : {
20198
+ "properties" : {
20199
+ "status" : {
20200
+ "enum" : [ "answered", "declined" ],
20201
+ "type" : "string"
20202
+ }
20203
+ },
20204
+ "required" : [ "status" ],
20205
+ "type" : "object"
20206
+ },
20207
+ "McpJsonRpcResponse" : {
20208
+ "description" : "Réponse JSON-RPC 2.0 ; `result` ou `error`, jamais les deux.",
20209
+ "properties" : {
20210
+ "jsonrpc" : {
20211
+ "enum" : [ "2.0" ],
20212
+ "type" : "string"
20213
+ },
20214
+ "id" : {
20215
+ "$ref" : "#/components/schemas/McpJsonRpcResponse_id"
20216
+ },
20217
+ "result" : {
20218
+ "$ref" : "#/components/schemas/McpCallToolResult"
20219
+ },
20220
+ "error" : {
20221
+ "$ref" : "#/components/schemas/McpJsonRpcError"
20222
+ }
20223
+ },
20224
+ "required" : [ "jsonrpc" ],
20225
+ "type" : "object"
20226
+ },
20227
+ "McpCallToolResult" : {
20228
+ "additionalProperties" : true,
20229
+ "description" : "Résultat d'un tools/call (CallToolResult MCP). Les autres méthodes (initialize, tools/list) rendent leur propre résultat, conforme à la spécification MCP.",
20230
+ "properties" : {
20231
+ "content" : {
20232
+ "description" : "Texte destiné au modèle, consigne suivante comprise.",
20233
+ "items" : {
20234
+ "$ref" : "#/components/schemas/McpTextContent"
20235
+ },
20236
+ "type" : "array"
20237
+ },
20238
+ "structuredContent" : {
20239
+ "$ref" : "#/components/schemas/McpCallToolResult_structuredContent"
20240
+ },
20241
+ "isError" : {
20242
+ "type" : "boolean"
20243
+ }
20244
+ },
20245
+ "type" : "object"
20246
+ },
20247
+ "McpTextContent" : {
20248
+ "properties" : {
20249
+ "type" : {
20250
+ "enum" : [ "text" ],
20251
+ "type" : "string"
20252
+ },
20253
+ "text" : {
20254
+ "type" : "string"
20255
+ }
20256
+ },
20257
+ "required" : [ "text", "type" ],
20258
+ "type" : "object"
20259
+ },
20260
+ "McpTicketView" : {
20261
+ "description" : "Contenu structuré rendu par les outils ask_agent et wait_for_reply. Tant que le statut est pending ou waiting_human, l'agent local rappelle wait_for_reply avec le ticket.",
20262
+ "properties" : {
20263
+ "status" : {
20264
+ "enum" : [ "pending", "waiting_human", "completed", "failed" ],
20265
+ "type" : "string"
20266
+ },
20267
+ "ticket" : {
20268
+ "description" : "`<conversationId>/<messageId>` du message qui portera la réponse.",
20269
+ "type" : "string"
20270
+ },
20271
+ "conversationId" : {
20272
+ "description" : "Fil à passer à ask_agent pour poursuivre dans la même conversation.",
20273
+ "format" : "uuid",
20274
+ "type" : "string"
20275
+ },
20276
+ "messageId" : {
20277
+ "format" : "uuid",
20278
+ "type" : "string"
20279
+ },
20280
+ "agentName" : {
20281
+ "type" : "string"
20282
+ },
20283
+ "reply" : {
20284
+ "description" : "Présent quand status vaut completed.",
20285
+ "type" : "string"
20286
+ },
20287
+ "activity" : {
20288
+ "description" : "Ce que fait l'agent quand status vaut pending.",
20289
+ "type" : "string"
20290
+ },
20291
+ "question" : {
20292
+ "description" : "Question posée à un humain quand status vaut waiting_human.",
20293
+ "type" : "string"
20294
+ },
20295
+ "options" : {
20296
+ "items" : {
20297
+ "type" : "string"
20298
+ },
20299
+ "type" : "array"
20300
+ },
20301
+ "human" : {
20302
+ "description" : "Nom ou e-mail de l'humain attendu.",
20303
+ "type" : "string"
20304
+ },
20305
+ "askingAgentName" : {
20306
+ "description" : "Agent qui pose la question, quand ce n'est pas l'agent interrogé (escalade en chaîne).",
20307
+ "type" : "string"
20308
+ },
20309
+ "expiresAt" : {
20310
+ "format" : "date-time",
20311
+ "type" : "string"
20312
+ },
20313
+ "error" : {
20314
+ "type" : "string"
20315
+ }
20316
+ },
20317
+ "required" : [ "conversationId", "messageId", "status", "ticket" ],
20318
+ "type" : "object"
20319
+ },
20320
+ "McpAgentList" : {
20321
+ "properties" : {
20322
+ "agents" : {
20323
+ "items" : {
20324
+ "$ref" : "#/components/schemas/McpAgentList_agents_inner"
20325
+ },
20326
+ "type" : "array"
20327
+ }
20328
+ },
20329
+ "required" : [ "agents" ],
20330
+ "type" : "object"
20331
+ },
20332
+ "McpJsonRpcError" : {
20333
+ "properties" : {
20334
+ "code" : {
20335
+ "description" : "-32000 méthode HTTP non supportée, -32001 clé API personnelle requise, -32603 erreur interne ; les codes JSON-RPC standards pour les requêtes mal formées.",
20336
+ "type" : "integer"
20337
+ },
20338
+ "message" : {
20339
+ "type" : "string"
20340
+ }
20341
+ },
20342
+ "required" : [ "code", "message" ],
20343
+ "type" : "object"
20344
+ },
20345
+ "McpJsonRpcRequest" : {
20346
+ "description" : "Message JSON-RPC 2.0 du Model Context Protocol (transport Streamable HTTP). Les méthodes utiles sont initialize, notifications/initialized, tools/list et tools/call. Un lot (tableau de messages) est aussi accepté par le transport.",
20347
+ "properties" : {
20348
+ "jsonrpc" : {
20349
+ "enum" : [ "2.0" ],
20350
+ "type" : "string"
20351
+ },
20352
+ "id" : {
20353
+ "$ref" : "#/components/schemas/McpJsonRpcRequest_id"
20354
+ },
20355
+ "method" : {
20356
+ "example" : "tools/call",
20357
+ "type" : "string"
20358
+ },
20359
+ "params" : {
20360
+ "additionalProperties" : true,
20361
+ "example" : {
20362
+ "name" : "ask_agent",
20363
+ "arguments" : {
20364
+ "agentId" : "Product Owner",
20365
+ "message" : "Quels sont les critères d'acceptation de la fonctionnalité X ?"
20366
+ }
20367
+ },
20368
+ "type" : "object"
20369
+ }
20370
+ },
20371
+ "required" : [ "jsonrpc", "method" ],
20372
+ "type" : "object"
20373
+ },
19763
20374
  "MarkConversationReadRequest" : {
19764
20375
  "properties" : {
19765
20376
  "readAt" : {
@@ -20440,6 +21051,92 @@
20440
21051
  },
20441
21052
  "type" : "array"
20442
21053
  },
21054
+ "OrganizationModelConsumption" : {
21055
+ "properties" : {
21056
+ "total" : {
21057
+ "$ref" : "#/components/schemas/OrganizationModelConsumption_total"
21058
+ },
21059
+ "byModel" : {
21060
+ "items" : {
21061
+ "$ref" : "#/components/schemas/ModelConsumptionItem"
21062
+ },
21063
+ "type" : "array"
21064
+ }
21065
+ },
21066
+ "required" : [ "byModel", "total" ],
21067
+ "type" : "object"
21068
+ },
21069
+ "ModelConsumptionItem" : {
21070
+ "properties" : {
21071
+ "provider" : {
21072
+ "description" : "Identifiant stable du moteur. Les lignes historiques d'agent portent encore le type (openai, mistral).",
21073
+ "type" : "string"
21074
+ },
21075
+ "providerName" : {
21076
+ "description" : "Nom du moteur écrit au moment de l'appel. Repli sur l'identifiant lorsqu'aucun nom n'est connu.",
21077
+ "type" : "string"
21078
+ },
21079
+ "model" : {
21080
+ "type" : "string"
21081
+ },
21082
+ "requests" : {
21083
+ "type" : "number"
21084
+ },
21085
+ "inputTokens" : {
21086
+ "type" : "number"
21087
+ },
21088
+ "outputTokens" : {
21089
+ "type" : "number"
21090
+ },
21091
+ "totalTokens" : {
21092
+ "type" : "number"
21093
+ },
21094
+ "sources" : {
21095
+ "items" : {
21096
+ "$ref" : "#/components/schemas/ModelConsumptionSlice"
21097
+ },
21098
+ "type" : "array"
21099
+ },
21100
+ "users" : {
21101
+ "items" : {
21102
+ "$ref" : "#/components/schemas/ModelConsumptionSlice"
21103
+ },
21104
+ "type" : "array"
21105
+ }
21106
+ },
21107
+ "required" : [ "inputTokens", "model", "outputTokens", "provider", "providerName", "requests", "sources", "totalTokens", "users" ],
21108
+ "type" : "object"
21109
+ },
21110
+ "ModelConsumptionSlice" : {
21111
+ "description" : "Part de consommation sur une source (agent, gateway, organisation) ou un utilisateur.",
21112
+ "properties" : {
21113
+ "key" : {
21114
+ "type" : "string"
21115
+ },
21116
+ "kind" : {
21117
+ "enum" : [ "agent", "gateway", "organization", "user" ],
21118
+ "type" : "string"
21119
+ },
21120
+ "label" : {
21121
+ "description" : "Nom d'agent ou email. Vide pour une consommation non attribuée à un utilisateur.",
21122
+ "type" : "string"
21123
+ },
21124
+ "requests" : {
21125
+ "type" : "number"
21126
+ },
21127
+ "inputTokens" : {
21128
+ "type" : "number"
21129
+ },
21130
+ "outputTokens" : {
21131
+ "type" : "number"
21132
+ },
21133
+ "totalTokens" : {
21134
+ "type" : "number"
21135
+ }
21136
+ },
21137
+ "required" : [ "inputTokens", "key", "kind", "label", "outputTokens", "requests", "totalTokens" ],
21138
+ "type" : "object"
21139
+ },
20443
21140
  "Guardian" : {
20444
21141
  "properties" : {
20445
21142
  "id" : {
@@ -25240,6 +25937,20 @@
25240
25937
  "required" : [ "tool" ],
25241
25938
  "type" : "object"
25242
25939
  },
25940
+ "ConversationHumanRequest_requestedBy" : {
25941
+ "properties" : {
25942
+ "kind" : {
25943
+ "enum" : [ "local_agent", "agent" ],
25944
+ "type" : "string"
25945
+ },
25946
+ "label" : {
25947
+ "description" : "Local client name (e.g. claude-code) or the calling agent's name.",
25948
+ "type" : "string"
25949
+ }
25950
+ },
25951
+ "required" : [ "kind" ],
25952
+ "type" : "object"
25953
+ },
25243
25954
  "FileAttachment_processed_oneOf" : {
25244
25955
  "properties" : {
25245
25956
  "type" : {
@@ -25749,6 +26460,61 @@
25749
26460
  "required" : [ "contentType", "ext", "size" ],
25750
26461
  "type" : "object"
25751
26462
  },
26463
+ "HumanRequestSummary_requestedBy" : {
26464
+ "properties" : {
26465
+ "kind" : {
26466
+ "enum" : [ "local_agent", "agent" ],
26467
+ "type" : "string"
26468
+ },
26469
+ "label" : {
26470
+ "type" : "string"
26471
+ }
26472
+ },
26473
+ "type" : "object"
26474
+ },
26475
+ "McpJsonRpcResponse_id" : {
26476
+ "nullable" : true,
26477
+ "oneOf" : [ {
26478
+ "type" : "string"
26479
+ }, {
26480
+ "type" : "integer"
26481
+ } ]
26482
+ },
26483
+ "McpCallToolResult_structuredContent" : {
26484
+ "description" : "McpTicketView pour ask_agent et wait_for_reply, McpAgentList pour list_agents.",
26485
+ "oneOf" : [ {
26486
+ "$ref" : "#/components/schemas/McpTicketView"
26487
+ }, {
26488
+ "$ref" : "#/components/schemas/McpAgentList"
26489
+ } ]
26490
+ },
26491
+ "McpAgentList_agents_inner" : {
26492
+ "properties" : {
26493
+ "id" : {
26494
+ "format" : "uuid",
26495
+ "type" : "string"
26496
+ },
26497
+ "name" : {
26498
+ "type" : "string"
26499
+ },
26500
+ "role" : {
26501
+ "type" : "string"
26502
+ },
26503
+ "description" : {
26504
+ "type" : "string"
26505
+ }
26506
+ },
26507
+ "required" : [ "id", "name" ],
26508
+ "type" : "object"
26509
+ },
26510
+ "McpJsonRpcRequest_id" : {
26511
+ "description" : "Absent sur une notification.",
26512
+ "oneOf" : [ {
26513
+ "type" : "string"
26514
+ }, {
26515
+ "type" : "integer"
26516
+ } ]
26517
+ },
25752
26518
  "ConversationSummary_agent_engine_provider" : {
25753
26519
  "properties" : {
25754
26520
  "name" : {
@@ -25926,6 +26692,27 @@
25926
26692
  "required" : [ "agentId", "agentName", "usage" ],
25927
26693
  "type" : "object"
25928
26694
  },
26695
+ "OrganizationModelConsumption_total" : {
26696
+ "properties" : {
26697
+ "requests" : {
26698
+ "type" : "number"
26699
+ },
26700
+ "inputTokens" : {
26701
+ "type" : "number"
26702
+ },
26703
+ "outputTokens" : {
26704
+ "type" : "number"
26705
+ },
26706
+ "totalTokens" : {
26707
+ "type" : "number"
26708
+ },
26709
+ "uniqueUsers" : {
26710
+ "type" : "number"
26711
+ }
26712
+ },
26713
+ "required" : [ "inputTokens", "outputTokens", "requests", "totalTokens", "uniqueUsers" ],
26714
+ "type" : "object"
26715
+ },
25929
26716
  "OrganizationMember_user" : {
25930
26717
  "properties" : {
25931
26718
  "email" : {