@breign/client 1.0.157 → 1.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis/ConversationsApi.d.ts +28 -1
- package/dist/apis/ConversationsApi.js +63 -0
- package/dist/apis/McpApi.d.ts +58 -0
- package/dist/apis/McpApi.js +154 -0
- package/dist/apis/ToolsApi.d.ts +46 -1
- package/dist/apis/ToolsApi.js +107 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/models/AgentChatOverviewEntryUio.d.ts +6 -0
- package/dist/models/AgentChatOverviewEntryUio.js +2 -0
- package/dist/models/AgentHumanEscalationConfigurationUio.d.ts +44 -0
- package/dist/models/AgentHumanEscalationConfigurationUio.js +52 -0
- package/dist/models/AgentMcpExposureConfigurationUio.d.ts +32 -0
- package/dist/models/AgentMcpExposureConfigurationUio.js +48 -0
- package/dist/models/AgentPatchUio.d.ts +17 -3
- package/dist/models/AgentPatchUio.js +9 -3
- package/dist/models/AgentUio.d.ts +14 -0
- package/dist/models/AgentUio.js +6 -0
- package/dist/models/ChatMessageUio.d.ts +7 -0
- package/dist/models/ChatMessageUio.js +3 -0
- package/dist/models/ConversationHumanRequestRequestedByUio.d.ts +46 -0
- package/dist/models/ConversationHumanRequestRequestedByUio.js +60 -0
- package/dist/models/ConversationHumanRequestUio.d.ts +109 -0
- package/dist/models/ConversationHumanRequestUio.js +93 -0
- package/dist/models/HumanRequestAnswerResultUio.d.ts +40 -0
- package/dist/models/HumanRequestAnswerResultUio.js +58 -0
- package/dist/models/HumanRequestAnswerUio.d.ts +38 -0
- package/dist/models/HumanRequestAnswerUio.js +50 -0
- package/dist/models/HumanRequestSummaryRequestedByUio.d.ts +46 -0
- package/dist/models/HumanRequestSummaryRequestedByUio.js +58 -0
- package/dist/models/HumanRequestSummaryUio.d.ts +93 -0
- package/dist/models/HumanRequestSummaryUio.js +81 -0
- package/dist/models/McpAgentListAgentsInnerUio.d.ts +50 -0
- package/dist/models/McpAgentListAgentsInnerUio.js +58 -0
- package/dist/models/McpAgentListUio.d.ts +33 -0
- package/dist/models/McpAgentListUio.js +51 -0
- package/dist/models/McpCallLogCursorUio.d.ts +38 -0
- package/dist/models/McpCallLogCursorUio.js +54 -0
- package/dist/models/McpCallLogEventUio.d.ts +27 -0
- package/dist/models/McpCallLogEventUio.js +53 -0
- package/dist/models/McpCallLogStatusUio.d.ts +25 -0
- package/dist/models/McpCallLogStatusUio.js +51 -0
- package/dist/models/McpCallLogUio.d.ts +162 -0
- package/dist/models/McpCallLogUio.js +114 -0
- package/dist/models/McpCallLogsDeletedResponseUio.d.ts +32 -0
- package/dist/models/McpCallLogsDeletedResponseUio.js +50 -0
- package/dist/models/McpCallLogsResponseUio.d.ts +58 -0
- package/dist/models/McpCallLogsResponseUio.js +68 -0
- package/dist/models/McpCallToolResultStructuredContentUio.d.ts +23 -0
- package/dist/models/McpCallToolResultStructuredContentUio.js +57 -0
- package/dist/models/McpCallToolResultUio.d.ts +47 -0
- package/dist/models/McpCallToolResultUio.js +56 -0
- package/dist/models/McpJsonRpcErrorUio.d.ts +38 -0
- package/dist/models/McpJsonRpcErrorUio.js +54 -0
- package/dist/models/McpJsonRpcRequestIdUio.d.ts +21 -0
- package/dist/models/McpJsonRpcRequestIdUio.js +37 -0
- package/dist/models/McpJsonRpcRequestUio.d.ts +60 -0
- package/dist/models/McpJsonRpcRequestUio.js +66 -0
- package/dist/models/McpJsonRpcResponseIdUio.d.ts +21 -0
- package/dist/models/McpJsonRpcResponseIdUio.js +37 -0
- package/dist/models/McpJsonRpcResponseUio.d.ts +60 -0
- package/dist/models/McpJsonRpcResponseUio.js +66 -0
- package/dist/models/McpLogsSettingsRequestUio.d.ts +38 -0
- package/dist/models/McpLogsSettingsRequestUio.js +50 -0
- package/dist/models/McpLogsSettingsResponseUio.d.ts +38 -0
- package/dist/models/McpLogsSettingsResponseUio.js +54 -0
- package/dist/models/McpTextContentUio.d.ts +45 -0
- package/dist/models/McpTextContentUio.js +61 -0
- package/dist/models/McpTicketViewUio.d.ts +114 -0
- package/dist/models/McpTicketViewUio.js +90 -0
- package/dist/models/index.d.ts +27 -0
- package/dist/models/index.js +27 -0
- package/dist/openapi.json +1058 -77
- package/package.json +1 -1
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { AgentChatOverviewEntryUio, AttachmentCreateRequestUio, AttachmentCreateResponseUio, AttachmentDetailsResponseUio, AttachmentProcessedRequestUio, BodyWithMessageUio, ContextLocationRequestUio, ContextUio, ConversationSummaryUio, CreateCustomVariable200ResponseUio, MarkConversationReadRequestUio, MessageAnonymizationUio, SetUserAgentConversationRequestUio, ToolCallResultRequestUio, ToolCallResultResponseUio, ToolCallsResponseUio, UpdateConversationTitleRequestUio, UpdateUserChatPreferencesRequestUio, UserChatPreferencesUio, WorkspaceFileContentUio, WorkspaceFileEntryUio, WorkspaceFileWriteRequestUio } from '../models/index';
|
|
13
|
+
import type { AgentChatOverviewEntryUio, AttachmentCreateRequestUio, AttachmentCreateResponseUio, AttachmentDetailsResponseUio, AttachmentProcessedRequestUio, BodyWithMessageUio, ContextLocationRequestUio, ContextUio, ConversationSummaryUio, CreateCustomVariable200ResponseUio, HumanRequestAnswerResultUio, HumanRequestAnswerUio, HumanRequestSummaryUio, MarkConversationReadRequestUio, MessageAnonymizationUio, SetUserAgentConversationRequestUio, ToolCallResultRequestUio, ToolCallResultResponseUio, ToolCallsResponseUio, UpdateConversationTitleRequestUio, UpdateUserChatPreferencesRequestUio, UserChatPreferencesUio, WorkspaceFileContentUio, WorkspaceFileEntryUio, WorkspaceFileWriteRequestUio } from '../models/index';
|
|
14
|
+
export interface AnswerHumanRequestRequest {
|
|
15
|
+
callId: string;
|
|
16
|
+
humanRequestAnswerUio: HumanRequestAnswerUio;
|
|
17
|
+
}
|
|
14
18
|
export interface ArchiveConversationByIdRequest {
|
|
15
19
|
conversationId: string;
|
|
16
20
|
}
|
|
@@ -82,6 +86,9 @@ export interface ListMessageToolCallsRequest {
|
|
|
82
86
|
messageId: string;
|
|
83
87
|
pending?: boolean;
|
|
84
88
|
}
|
|
89
|
+
export interface ListPendingHumanRequestsRequest {
|
|
90
|
+
organizationId: string;
|
|
91
|
+
}
|
|
85
92
|
export interface MarkAttachmentProcessedRequest {
|
|
86
93
|
conversationId: string;
|
|
87
94
|
attachmentId: string;
|
|
@@ -126,6 +133,16 @@ export interface UploadAttachmentRequest {
|
|
|
126
133
|
*
|
|
127
134
|
*/
|
|
128
135
|
export declare class ConversationsApi extends runtime.BaseAPI {
|
|
136
|
+
/**
|
|
137
|
+
* 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.
|
|
138
|
+
* Answer a question asked by an agent
|
|
139
|
+
*/
|
|
140
|
+
answerHumanRequestRaw(requestParameters: AnswerHumanRequestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HumanRequestAnswerResultUio>>;
|
|
141
|
+
/**
|
|
142
|
+
* 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.
|
|
143
|
+
* Answer a question asked by an agent
|
|
144
|
+
*/
|
|
145
|
+
answerHumanRequest(callId: string, humanRequestAnswerUio: HumanRequestAnswerUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HumanRequestAnswerResultUio>;
|
|
129
146
|
/**
|
|
130
147
|
* Archives a specific conversation by its ID.
|
|
131
148
|
* Archive a conversation.
|
|
@@ -312,6 +329,16 @@ export declare class ConversationsApi extends runtime.BaseAPI {
|
|
|
312
329
|
* List the tool calls of a message
|
|
313
330
|
*/
|
|
314
331
|
listMessageToolCalls(conversationId: string, messageId: string, pending?: boolean, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolCallsResponseUio>;
|
|
332
|
+
/**
|
|
333
|
+
* 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.
|
|
334
|
+
* List the questions waiting for the current user
|
|
335
|
+
*/
|
|
336
|
+
listPendingHumanRequestsRaw(requestParameters: ListPendingHumanRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<HumanRequestSummaryUio>>>;
|
|
337
|
+
/**
|
|
338
|
+
* 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.
|
|
339
|
+
* List the questions waiting for the current user
|
|
340
|
+
*/
|
|
341
|
+
listPendingHumanRequests(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<HumanRequestSummaryUio>>;
|
|
315
342
|
/**
|
|
316
343
|
* Internal callback endpoint called when attachment processing is complete. Réservé au service de documents : tout autre appelant reçoit un 403. L\'attachment doit être en état `PROCESSING`.
|
|
317
344
|
* Mark a conversation attachment as processed
|
|
@@ -53,6 +53,40 @@ const index_1 = require("../models/index");
|
|
|
53
53
|
*
|
|
54
54
|
*/
|
|
55
55
|
class ConversationsApi extends runtime.BaseAPI {
|
|
56
|
+
/**
|
|
57
|
+
* 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.
|
|
58
|
+
* Answer a question asked by an agent
|
|
59
|
+
*/
|
|
60
|
+
async answerHumanRequestRaw(requestParameters, initOverrides) {
|
|
61
|
+
if (requestParameters['callId'] == null) {
|
|
62
|
+
throw new runtime.RequiredError('callId', 'Required parameter "callId" was null or undefined when calling answerHumanRequest().');
|
|
63
|
+
}
|
|
64
|
+
if (requestParameters['humanRequestAnswerUio'] == null) {
|
|
65
|
+
throw new runtime.RequiredError('humanRequestAnswerUio', 'Required parameter "humanRequestAnswerUio" was null or undefined when calling answerHumanRequest().');
|
|
66
|
+
}
|
|
67
|
+
const queryParameters = {};
|
|
68
|
+
const headerParameters = {};
|
|
69
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
70
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
71
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
72
|
+
}
|
|
73
|
+
const response = await this.request({
|
|
74
|
+
path: `/human-requests/{callId}/answer`.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId']))),
|
|
75
|
+
method: 'POST',
|
|
76
|
+
headers: headerParameters,
|
|
77
|
+
query: queryParameters,
|
|
78
|
+
body: (0, index_1.HumanRequestAnswerUioToJSON)(requestParameters['humanRequestAnswerUio']),
|
|
79
|
+
}, initOverrides);
|
|
80
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.HumanRequestAnswerResultUioFromJSON)(jsonValue));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 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.
|
|
84
|
+
* Answer a question asked by an agent
|
|
85
|
+
*/
|
|
86
|
+
async answerHumanRequest(callId, humanRequestAnswerUio, initOverrides) {
|
|
87
|
+
const response = await this.answerHumanRequestRaw({ callId: callId, humanRequestAnswerUio: humanRequestAnswerUio }, initOverrides);
|
|
88
|
+
return await response.value();
|
|
89
|
+
}
|
|
56
90
|
/**
|
|
57
91
|
* Archives a specific conversation by its ID.
|
|
58
92
|
* Archive a conversation.
|
|
@@ -630,6 +664,35 @@ class ConversationsApi extends runtime.BaseAPI {
|
|
|
630
664
|
const response = await this.listMessageToolCallsRaw({ conversationId: conversationId, messageId: messageId, pending: pending }, initOverrides);
|
|
631
665
|
return await response.value();
|
|
632
666
|
}
|
|
667
|
+
/**
|
|
668
|
+
* 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.
|
|
669
|
+
* List the questions waiting for the current user
|
|
670
|
+
*/
|
|
671
|
+
async listPendingHumanRequestsRaw(requestParameters, initOverrides) {
|
|
672
|
+
if (requestParameters['organizationId'] == null) {
|
|
673
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling listPendingHumanRequests().');
|
|
674
|
+
}
|
|
675
|
+
const queryParameters = {};
|
|
676
|
+
const headerParameters = {};
|
|
677
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
678
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
679
|
+
}
|
|
680
|
+
const response = await this.request({
|
|
681
|
+
path: `/organizations/{organizationId}/chat/human-requests`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
|
|
682
|
+
method: 'GET',
|
|
683
|
+
headers: headerParameters,
|
|
684
|
+
query: queryParameters,
|
|
685
|
+
}, initOverrides);
|
|
686
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.HumanRequestSummaryUioFromJSON));
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* 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.
|
|
690
|
+
* List the questions waiting for the current user
|
|
691
|
+
*/
|
|
692
|
+
async listPendingHumanRequests(organizationId, initOverrides) {
|
|
693
|
+
const response = await this.listPendingHumanRequestsRaw({ organizationId: organizationId }, initOverrides);
|
|
694
|
+
return await response.value();
|
|
695
|
+
}
|
|
633
696
|
/**
|
|
634
697
|
* Internal callback endpoint called when attachment processing is complete. Réservé au service de documents : tout autre appelant reçoit un 403. L\'attachment doit être en état `PROCESSING`.
|
|
635
698
|
* Mark a conversation attachment as processed
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* brain-client
|
|
3
|
+
* Api ands models for brain-app and brain-app
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.0.0-SNAPSHOT
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { McpJsonRpcRequestUio, McpJsonRpcResponseUio } from '../models/index';
|
|
14
|
+
export interface DeleteMcpSessionRequest {
|
|
15
|
+
organizationId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GetMcpStreamRequest {
|
|
18
|
+
organizationId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface HandleMcpRequestRequest {
|
|
21
|
+
organizationId: string;
|
|
22
|
+
mcpJsonRpcRequestUio: McpJsonRpcRequestUio;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export declare class McpApi extends runtime.BaseAPI {
|
|
28
|
+
/**
|
|
29
|
+
* Aucune session à clore : le transport est sans état.
|
|
30
|
+
* Not supported (stateless MCP server)
|
|
31
|
+
*/
|
|
32
|
+
deleteMcpSessionRaw(requestParameters: DeleteMcpSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
33
|
+
/**
|
|
34
|
+
* Aucune session à clore : le transport est sans état.
|
|
35
|
+
* Not supported (stateless MCP server)
|
|
36
|
+
*/
|
|
37
|
+
deleteMcpSession(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Pas de flux SSE côté serveur : le transport est sans état.
|
|
40
|
+
* Not supported (stateless MCP server)
|
|
41
|
+
*/
|
|
42
|
+
getMcpStreamRaw(requestParameters: GetMcpStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
43
|
+
/**
|
|
44
|
+
* Pas de flux SSE côté serveur : le transport est sans état.
|
|
45
|
+
* Not supported (stateless MCP server)
|
|
46
|
+
*/
|
|
47
|
+
getMcpStream(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* 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. Authentification 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. Outils exposés : - `list_agents` — agents joignables, avec leur rôle et leur description. - `ask_agent` `{ agentId, message, conversationId?, waitSeconds? }` — pose une question ; attend la réponse jusqu\'à `waitSeconds` (25 s par défaut, 50 s max), sinon rend un ticket. - `wait_for_reply` `{ ticket, timeoutSeconds? }` — attend la réponse d\'un ticket (45 s par défaut, 50 s max). Chaque 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. Configuration 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`).
|
|
50
|
+
* MCP server for local agents
|
|
51
|
+
*/
|
|
52
|
+
handleMcpRequestRaw(requestParameters: HandleMcpRequestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<McpJsonRpcResponseUio>>;
|
|
53
|
+
/**
|
|
54
|
+
* 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. Authentification 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. Outils exposés : - `list_agents` — agents joignables, avec leur rôle et leur description. - `ask_agent` `{ agentId, message, conversationId?, waitSeconds? }` — pose une question ; attend la réponse jusqu\'à `waitSeconds` (25 s par défaut, 50 s max), sinon rend un ticket. - `wait_for_reply` `{ ticket, timeoutSeconds? }` — attend la réponse d\'un ticket (45 s par défaut, 50 s max). Chaque 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. Configuration 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`).
|
|
55
|
+
* MCP server for local agents
|
|
56
|
+
*/
|
|
57
|
+
handleMcpRequest(organizationId: string, mcpJsonRpcRequestUio: McpJsonRpcRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<McpJsonRpcResponseUio | null | undefined>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* brain-client
|
|
6
|
+
* Api ands models for brain-app and brain-app
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.0-SNAPSHOT
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.McpApi = void 0;
|
|
50
|
+
const runtime = __importStar(require("../runtime"));
|
|
51
|
+
const index_1 = require("../models/index");
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
class McpApi extends runtime.BaseAPI {
|
|
56
|
+
/**
|
|
57
|
+
* Aucune session à clore : le transport est sans état.
|
|
58
|
+
* Not supported (stateless MCP server)
|
|
59
|
+
*/
|
|
60
|
+
async deleteMcpSessionRaw(requestParameters, initOverrides) {
|
|
61
|
+
if (requestParameters['organizationId'] == null) {
|
|
62
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling deleteMcpSession().');
|
|
63
|
+
}
|
|
64
|
+
const queryParameters = {};
|
|
65
|
+
const headerParameters = {};
|
|
66
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
67
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
68
|
+
}
|
|
69
|
+
const response = await this.request({
|
|
70
|
+
path: `/organizations/{organizationId}/mcp`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
|
|
71
|
+
method: 'DELETE',
|
|
72
|
+
headers: headerParameters,
|
|
73
|
+
query: queryParameters,
|
|
74
|
+
}, initOverrides);
|
|
75
|
+
return new runtime.VoidApiResponse(response);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Aucune session à clore : le transport est sans état.
|
|
79
|
+
* Not supported (stateless MCP server)
|
|
80
|
+
*/
|
|
81
|
+
async deleteMcpSession(organizationId, initOverrides) {
|
|
82
|
+
await this.deleteMcpSessionRaw({ organizationId: organizationId }, initOverrides);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Pas de flux SSE côté serveur : le transport est sans état.
|
|
86
|
+
* Not supported (stateless MCP server)
|
|
87
|
+
*/
|
|
88
|
+
async getMcpStreamRaw(requestParameters, initOverrides) {
|
|
89
|
+
if (requestParameters['organizationId'] == null) {
|
|
90
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getMcpStream().');
|
|
91
|
+
}
|
|
92
|
+
const queryParameters = {};
|
|
93
|
+
const headerParameters = {};
|
|
94
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
95
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
96
|
+
}
|
|
97
|
+
const response = await this.request({
|
|
98
|
+
path: `/organizations/{organizationId}/mcp`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
|
|
99
|
+
method: 'GET',
|
|
100
|
+
headers: headerParameters,
|
|
101
|
+
query: queryParameters,
|
|
102
|
+
}, initOverrides);
|
|
103
|
+
return new runtime.VoidApiResponse(response);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Pas de flux SSE côté serveur : le transport est sans état.
|
|
107
|
+
* Not supported (stateless MCP server)
|
|
108
|
+
*/
|
|
109
|
+
async getMcpStream(organizationId, initOverrides) {
|
|
110
|
+
await this.getMcpStreamRaw({ organizationId: organizationId }, initOverrides);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* 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. Authentification 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. Outils exposés : - `list_agents` — agents joignables, avec leur rôle et leur description. - `ask_agent` `{ agentId, message, conversationId?, waitSeconds? }` — pose une question ; attend la réponse jusqu\'à `waitSeconds` (25 s par défaut, 50 s max), sinon rend un ticket. - `wait_for_reply` `{ ticket, timeoutSeconds? }` — attend la réponse d\'un ticket (45 s par défaut, 50 s max). Chaque 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. Configuration 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`).
|
|
114
|
+
* MCP server for local agents
|
|
115
|
+
*/
|
|
116
|
+
async handleMcpRequestRaw(requestParameters, initOverrides) {
|
|
117
|
+
if (requestParameters['organizationId'] == null) {
|
|
118
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling handleMcpRequest().');
|
|
119
|
+
}
|
|
120
|
+
if (requestParameters['mcpJsonRpcRequestUio'] == null) {
|
|
121
|
+
throw new runtime.RequiredError('mcpJsonRpcRequestUio', 'Required parameter "mcpJsonRpcRequestUio" was null or undefined when calling handleMcpRequest().');
|
|
122
|
+
}
|
|
123
|
+
const queryParameters = {};
|
|
124
|
+
const headerParameters = {};
|
|
125
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
126
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
127
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
128
|
+
}
|
|
129
|
+
const response = await this.request({
|
|
130
|
+
path: `/organizations/{organizationId}/mcp`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
|
|
131
|
+
method: 'POST',
|
|
132
|
+
headers: headerParameters,
|
|
133
|
+
query: queryParameters,
|
|
134
|
+
body: (0, index_1.McpJsonRpcRequestUioToJSON)(requestParameters['mcpJsonRpcRequestUio']),
|
|
135
|
+
}, initOverrides);
|
|
136
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.McpJsonRpcResponseUioFromJSON)(jsonValue));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 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. Authentification 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. Outils exposés : - `list_agents` — agents joignables, avec leur rôle et leur description. - `ask_agent` `{ agentId, message, conversationId?, waitSeconds? }` — pose une question ; attend la réponse jusqu\'à `waitSeconds` (25 s par défaut, 50 s max), sinon rend un ticket. - `wait_for_reply` `{ ticket, timeoutSeconds? }` — attend la réponse d\'un ticket (45 s par défaut, 50 s max). Chaque 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. Configuration 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`).
|
|
140
|
+
* MCP server for local agents
|
|
141
|
+
*/
|
|
142
|
+
async handleMcpRequest(organizationId, mcpJsonRpcRequestUio, initOverrides) {
|
|
143
|
+
const response = await this.handleMcpRequestRaw({ organizationId: organizationId, mcpJsonRpcRequestUio: mcpJsonRpcRequestUio }, initOverrides);
|
|
144
|
+
switch (response.raw.status) {
|
|
145
|
+
case 200:
|
|
146
|
+
return await response.value();
|
|
147
|
+
case 202:
|
|
148
|
+
return null;
|
|
149
|
+
default:
|
|
150
|
+
return await response.value();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.McpApi = McpApi;
|
package/dist/apis/ToolsApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { AgentToolUio, ConnectOAuth2Tool200ResponseUio, IntrospectMcpTool200ResponseUio, RevealTokenRequestUio, RevealTokenResponseUio, STTResponseUio, SetTokenRequestUio, SetupToolRequestUio, TTSRequestUio, TTSResponseUio, ToolAllowedToolsRequestUio, ToolAllowedToolsResponseUio, ToolConnectionStatusResponseUio, ToolCreateRequestUio, ToolSecureUio, ToolUpdateRequestUio, UpdateToolStaticCredentialsRequestUio } from '../models/index';
|
|
13
|
+
import type { AgentToolUio, ConnectOAuth2Tool200ResponseUio, IntrospectMcpTool200ResponseUio, McpCallLogEventUio, McpCallLogStatusUio, McpCallLogsDeletedResponseUio, McpCallLogsResponseUio, McpLogsSettingsRequestUio, McpLogsSettingsResponseUio, RevealTokenRequestUio, RevealTokenResponseUio, STTResponseUio, SetTokenRequestUio, SetupToolRequestUio, TTSRequestUio, TTSResponseUio, ToolAllowedToolsRequestUio, ToolAllowedToolsResponseUio, ToolConnectionStatusResponseUio, ToolCreateRequestUio, ToolSecureUio, ToolUpdateRequestUio, UpdateToolStaticCredentialsRequestUio } from '../models/index';
|
|
14
14
|
export interface ConnectOAuth2ToolRequest {
|
|
15
15
|
toolId: string;
|
|
16
16
|
}
|
|
@@ -28,6 +28,9 @@ export interface ConvertTextToSpeechRequest {
|
|
|
28
28
|
export interface CreateToolRequest {
|
|
29
29
|
toolCreateRequestUio: ToolCreateRequestUio;
|
|
30
30
|
}
|
|
31
|
+
export interface DeleteMcpCallLogsRequest {
|
|
32
|
+
toolId: string;
|
|
33
|
+
}
|
|
31
34
|
export interface DeleteToolRequest {
|
|
32
35
|
toolId: string;
|
|
33
36
|
}
|
|
@@ -46,6 +49,14 @@ export interface GetToolSecureRequest {
|
|
|
46
49
|
export interface IntrospectMcpToolRequest {
|
|
47
50
|
toolId: string;
|
|
48
51
|
}
|
|
52
|
+
export interface ListMcpCallLogsRequest {
|
|
53
|
+
toolId: string;
|
|
54
|
+
event?: McpCallLogEventUio;
|
|
55
|
+
status?: McpCallLogStatusUio;
|
|
56
|
+
limit?: number;
|
|
57
|
+
beforeCreatedAt?: string;
|
|
58
|
+
beforeId?: string;
|
|
59
|
+
}
|
|
49
60
|
export interface RevealToolTokenRequest {
|
|
50
61
|
toolId: string;
|
|
51
62
|
revealTokenRequestUio: RevealTokenRequestUio;
|
|
@@ -69,6 +80,10 @@ export interface UpdateMcpAllowedToolsRequest {
|
|
|
69
80
|
toolId: string;
|
|
70
81
|
toolAllowedToolsRequestUio: ToolAllowedToolsRequestUio;
|
|
71
82
|
}
|
|
83
|
+
export interface UpdateMcpLogsSettingsRequest {
|
|
84
|
+
toolId: string;
|
|
85
|
+
mcpLogsSettingsRequestUio: McpLogsSettingsRequestUio;
|
|
86
|
+
}
|
|
72
87
|
export interface UpdateToolRequest {
|
|
73
88
|
toolId: string;
|
|
74
89
|
toolUpdateRequestUio: ToolUpdateRequestUio;
|
|
@@ -121,6 +136,16 @@ export declare class ToolsApi extends runtime.BaseAPI {
|
|
|
121
136
|
* Create a new tool
|
|
122
137
|
*/
|
|
123
138
|
createTool(toolCreateRequestUio: ToolCreateRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentToolUio>;
|
|
139
|
+
/**
|
|
140
|
+
* Drops every trace of this tool. The way out when payload capture was left on and recorded something it should not have.
|
|
141
|
+
* Erase the MCP traces of a tool
|
|
142
|
+
*/
|
|
143
|
+
deleteMcpCallLogsRaw(requestParameters: DeleteMcpCallLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<McpCallLogsDeletedResponseUio>>;
|
|
144
|
+
/**
|
|
145
|
+
* Drops every trace of this tool. The way out when payload capture was left on and recorded something it should not have.
|
|
146
|
+
* Erase the MCP traces of a tool
|
|
147
|
+
*/
|
|
148
|
+
deleteMcpCallLogs(toolId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<McpCallLogsDeletedResponseUio>;
|
|
124
149
|
/**
|
|
125
150
|
* Delete a tool
|
|
126
151
|
*/
|
|
@@ -189,6 +214,16 @@ export declare class ToolsApi extends runtime.BaseAPI {
|
|
|
189
214
|
* Introspect an MCP tool server to refresh available actions
|
|
190
215
|
*/
|
|
191
216
|
introspectMcpTool(toolId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IntrospectMcpTool200ResponseUio>;
|
|
217
|
+
/**
|
|
218
|
+
* Traces of the exchanges with the MCP server of this tool, most recent first: connections, token refreshes, tool calls, and the configuration changes an administrator made. Reserved to administrators of the organisation owning the tool — a trace names the methods called and, when payload capture is on, carries an excerpt of the exchange. Paging walks backwards through time with a composite cursor. Both halves of `nextCursor` must be sent back together: a date alone cannot separate two traces written in the same millisecond.
|
|
219
|
+
* Read the MCP traces of a tool
|
|
220
|
+
*/
|
|
221
|
+
listMcpCallLogsRaw(requestParameters: ListMcpCallLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<McpCallLogsResponseUio>>;
|
|
222
|
+
/**
|
|
223
|
+
* Traces of the exchanges with the MCP server of this tool, most recent first: connections, token refreshes, tool calls, and the configuration changes an administrator made. Reserved to administrators of the organisation owning the tool — a trace names the methods called and, when payload capture is on, carries an excerpt of the exchange. Paging walks backwards through time with a composite cursor. Both halves of `nextCursor` must be sent back together: a date alone cannot separate two traces written in the same millisecond.
|
|
224
|
+
* Read the MCP traces of a tool
|
|
225
|
+
*/
|
|
226
|
+
listMcpCallLogs(toolId: string, event?: McpCallLogEventUio, status?: McpCallLogStatusUio, limit?: number, beforeCreatedAt?: string, beforeId?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<McpCallLogsResponseUio>;
|
|
192
227
|
/**
|
|
193
228
|
* Returns the raw token if it exists and the caller is authorized.
|
|
194
229
|
* Reveal stored tool token (masked in GET)
|
|
@@ -235,6 +270,16 @@ export declare class ToolsApi extends runtime.BaseAPI {
|
|
|
235
270
|
* Replace the list of allowed MCP tools for an MCP tool
|
|
236
271
|
*/
|
|
237
272
|
updateMcpAllowedTools(toolId: string, toolAllowedToolsRequestUio: ToolAllowedToolsRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolAllowedToolsResponseUio>;
|
|
273
|
+
/**
|
|
274
|
+
* Whether the arguments and responses of the calls to this tool are kept in its traces. Off by default, and deliberately its own endpoint rather than a field of the tool: the arguments of an MCP call carry whatever the user asked for, so switching capture on is a debugging act an administrator takes knowingly, and the tool edit form can never reset it by accident.
|
|
275
|
+
* Turn MCP payload capture on or off for a tool
|
|
276
|
+
*/
|
|
277
|
+
updateMcpLogsSettingsRaw(requestParameters: UpdateMcpLogsSettingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<McpLogsSettingsResponseUio>>;
|
|
278
|
+
/**
|
|
279
|
+
* Whether the arguments and responses of the calls to this tool are kept in its traces. Off by default, and deliberately its own endpoint rather than a field of the tool: the arguments of an MCP call carry whatever the user asked for, so switching capture on is a debugging act an administrator takes knowingly, and the tool edit form can never reset it by accident.
|
|
280
|
+
* Turn MCP payload capture on or off for a tool
|
|
281
|
+
*/
|
|
282
|
+
updateMcpLogsSettings(toolId: string, mcpLogsSettingsRequestUio: McpLogsSettingsRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<McpLogsSettingsResponseUio>;
|
|
238
283
|
/**
|
|
239
284
|
* Update a tool
|
|
240
285
|
*/
|
package/dist/apis/ToolsApi.js
CHANGED
|
@@ -193,6 +193,35 @@ class ToolsApi extends runtime.BaseAPI {
|
|
|
193
193
|
const response = await this.createToolRaw({ toolCreateRequestUio: toolCreateRequestUio }, initOverrides);
|
|
194
194
|
return await response.value();
|
|
195
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Drops every trace of this tool. The way out when payload capture was left on and recorded something it should not have.
|
|
198
|
+
* Erase the MCP traces of a tool
|
|
199
|
+
*/
|
|
200
|
+
async deleteMcpCallLogsRaw(requestParameters, initOverrides) {
|
|
201
|
+
if (requestParameters['toolId'] == null) {
|
|
202
|
+
throw new runtime.RequiredError('toolId', 'Required parameter "toolId" was null or undefined when calling deleteMcpCallLogs().');
|
|
203
|
+
}
|
|
204
|
+
const queryParameters = {};
|
|
205
|
+
const headerParameters = {};
|
|
206
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
207
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
208
|
+
}
|
|
209
|
+
const response = await this.request({
|
|
210
|
+
path: `/tools/{toolId}/mcp/logs`.replace(`{${"toolId"}}`, encodeURIComponent(String(requestParameters['toolId']))),
|
|
211
|
+
method: 'DELETE',
|
|
212
|
+
headers: headerParameters,
|
|
213
|
+
query: queryParameters,
|
|
214
|
+
}, initOverrides);
|
|
215
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.McpCallLogsDeletedResponseUioFromJSON)(jsonValue));
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Drops every trace of this tool. The way out when payload capture was left on and recorded something it should not have.
|
|
219
|
+
* Erase the MCP traces of a tool
|
|
220
|
+
*/
|
|
221
|
+
async deleteMcpCallLogs(toolId, initOverrides) {
|
|
222
|
+
const response = await this.deleteMcpCallLogsRaw({ toolId: toolId }, initOverrides);
|
|
223
|
+
return await response.value();
|
|
224
|
+
}
|
|
196
225
|
/**
|
|
197
226
|
* Delete a tool
|
|
198
227
|
*/
|
|
@@ -384,6 +413,50 @@ class ToolsApi extends runtime.BaseAPI {
|
|
|
384
413
|
const response = await this.introspectMcpToolRaw({ toolId: toolId }, initOverrides);
|
|
385
414
|
return await response.value();
|
|
386
415
|
}
|
|
416
|
+
/**
|
|
417
|
+
* Traces of the exchanges with the MCP server of this tool, most recent first: connections, token refreshes, tool calls, and the configuration changes an administrator made. Reserved to administrators of the organisation owning the tool — a trace names the methods called and, when payload capture is on, carries an excerpt of the exchange. Paging walks backwards through time with a composite cursor. Both halves of `nextCursor` must be sent back together: a date alone cannot separate two traces written in the same millisecond.
|
|
418
|
+
* Read the MCP traces of a tool
|
|
419
|
+
*/
|
|
420
|
+
async listMcpCallLogsRaw(requestParameters, initOverrides) {
|
|
421
|
+
if (requestParameters['toolId'] == null) {
|
|
422
|
+
throw new runtime.RequiredError('toolId', 'Required parameter "toolId" was null or undefined when calling listMcpCallLogs().');
|
|
423
|
+
}
|
|
424
|
+
const queryParameters = {};
|
|
425
|
+
if (requestParameters['event'] != null) {
|
|
426
|
+
queryParameters['event'] = requestParameters['event'];
|
|
427
|
+
}
|
|
428
|
+
if (requestParameters['status'] != null) {
|
|
429
|
+
queryParameters['status'] = requestParameters['status'];
|
|
430
|
+
}
|
|
431
|
+
if (requestParameters['limit'] != null) {
|
|
432
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
433
|
+
}
|
|
434
|
+
if (requestParameters['beforeCreatedAt'] != null) {
|
|
435
|
+
queryParameters['beforeCreatedAt'] = requestParameters['beforeCreatedAt'];
|
|
436
|
+
}
|
|
437
|
+
if (requestParameters['beforeId'] != null) {
|
|
438
|
+
queryParameters['beforeId'] = requestParameters['beforeId'];
|
|
439
|
+
}
|
|
440
|
+
const headerParameters = {};
|
|
441
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
442
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
443
|
+
}
|
|
444
|
+
const response = await this.request({
|
|
445
|
+
path: `/tools/{toolId}/mcp/logs`.replace(`{${"toolId"}}`, encodeURIComponent(String(requestParameters['toolId']))),
|
|
446
|
+
method: 'GET',
|
|
447
|
+
headers: headerParameters,
|
|
448
|
+
query: queryParameters,
|
|
449
|
+
}, initOverrides);
|
|
450
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.McpCallLogsResponseUioFromJSON)(jsonValue));
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Traces of the exchanges with the MCP server of this tool, most recent first: connections, token refreshes, tool calls, and the configuration changes an administrator made. Reserved to administrators of the organisation owning the tool — a trace names the methods called and, when payload capture is on, carries an excerpt of the exchange. Paging walks backwards through time with a composite cursor. Both halves of `nextCursor` must be sent back together: a date alone cannot separate two traces written in the same millisecond.
|
|
454
|
+
* Read the MCP traces of a tool
|
|
455
|
+
*/
|
|
456
|
+
async listMcpCallLogs(toolId, event, status, limit, beforeCreatedAt, beforeId, initOverrides) {
|
|
457
|
+
const response = await this.listMcpCallLogsRaw({ toolId: toolId, event: event, status: status, limit: limit, beforeCreatedAt: beforeCreatedAt, beforeId: beforeId }, initOverrides);
|
|
458
|
+
return await response.value();
|
|
459
|
+
}
|
|
387
460
|
/**
|
|
388
461
|
* Returns the raw token if it exists and the caller is authorized.
|
|
389
462
|
* Reveal stored tool token (masked in GET)
|
|
@@ -555,6 +628,40 @@ class ToolsApi extends runtime.BaseAPI {
|
|
|
555
628
|
const response = await this.updateMcpAllowedToolsRaw({ toolId: toolId, toolAllowedToolsRequestUio: toolAllowedToolsRequestUio }, initOverrides);
|
|
556
629
|
return await response.value();
|
|
557
630
|
}
|
|
631
|
+
/**
|
|
632
|
+
* Whether the arguments and responses of the calls to this tool are kept in its traces. Off by default, and deliberately its own endpoint rather than a field of the tool: the arguments of an MCP call carry whatever the user asked for, so switching capture on is a debugging act an administrator takes knowingly, and the tool edit form can never reset it by accident.
|
|
633
|
+
* Turn MCP payload capture on or off for a tool
|
|
634
|
+
*/
|
|
635
|
+
async updateMcpLogsSettingsRaw(requestParameters, initOverrides) {
|
|
636
|
+
if (requestParameters['toolId'] == null) {
|
|
637
|
+
throw new runtime.RequiredError('toolId', 'Required parameter "toolId" was null or undefined when calling updateMcpLogsSettings().');
|
|
638
|
+
}
|
|
639
|
+
if (requestParameters['mcpLogsSettingsRequestUio'] == null) {
|
|
640
|
+
throw new runtime.RequiredError('mcpLogsSettingsRequestUio', 'Required parameter "mcpLogsSettingsRequestUio" was null or undefined when calling updateMcpLogsSettings().');
|
|
641
|
+
}
|
|
642
|
+
const queryParameters = {};
|
|
643
|
+
const headerParameters = {};
|
|
644
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
645
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
646
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
647
|
+
}
|
|
648
|
+
const response = await this.request({
|
|
649
|
+
path: `/tools/{toolId}/mcp/logs/settings`.replace(`{${"toolId"}}`, encodeURIComponent(String(requestParameters['toolId']))),
|
|
650
|
+
method: 'PUT',
|
|
651
|
+
headers: headerParameters,
|
|
652
|
+
query: queryParameters,
|
|
653
|
+
body: (0, index_1.McpLogsSettingsRequestUioToJSON)(requestParameters['mcpLogsSettingsRequestUio']),
|
|
654
|
+
}, initOverrides);
|
|
655
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.McpLogsSettingsResponseUioFromJSON)(jsonValue));
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Whether the arguments and responses of the calls to this tool are kept in its traces. Off by default, and deliberately its own endpoint rather than a field of the tool: the arguments of an MCP call carry whatever the user asked for, so switching capture on is a debugging act an administrator takes knowingly, and the tool edit form can never reset it by accident.
|
|
659
|
+
* Turn MCP payload capture on or off for a tool
|
|
660
|
+
*/
|
|
661
|
+
async updateMcpLogsSettings(toolId, mcpLogsSettingsRequestUio, initOverrides) {
|
|
662
|
+
const response = await this.updateMcpLogsSettingsRaw({ toolId: toolId, mcpLogsSettingsRequestUio: mcpLogsSettingsRequestUio }, initOverrides);
|
|
663
|
+
return await response.value();
|
|
664
|
+
}
|
|
558
665
|
/**
|
|
559
666
|
* Update a tool
|
|
560
667
|
*/
|
package/dist/apis/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from './InstancesApi';
|
|
|
16
16
|
export * from './KnowledgeApi';
|
|
17
17
|
export * from './LibraryAgentsApi';
|
|
18
18
|
export * from './ManifestsApi';
|
|
19
|
+
export * from './McpApi';
|
|
19
20
|
export * from './MetricsApi';
|
|
20
21
|
export * from './OrganizationsApi';
|
|
21
22
|
export * from './PromptsApi';
|
package/dist/apis/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./InstancesApi"), exports);
|
|
|
34
34
|
__exportStar(require("./KnowledgeApi"), exports);
|
|
35
35
|
__exportStar(require("./LibraryAgentsApi"), exports);
|
|
36
36
|
__exportStar(require("./ManifestsApi"), exports);
|
|
37
|
+
__exportStar(require("./McpApi"), exports);
|
|
37
38
|
__exportStar(require("./MetricsApi"), exports);
|
|
38
39
|
__exportStar(require("./OrganizationsApi"), exports);
|
|
39
40
|
__exportStar(require("./PromptsApi"), exports);
|
|
@@ -45,6 +45,12 @@ export interface AgentChatOverviewEntryUio {
|
|
|
45
45
|
* @memberof AgentChatOverviewEntryUio
|
|
46
46
|
*/
|
|
47
47
|
isGenerating: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Questions de cet agent qui attendent une réponse de l'utilisateur courant (outil Human_ask), toutes tâches confondues.
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof AgentChatOverviewEntryUio
|
|
52
|
+
*/
|
|
53
|
+
pendingHumanRequests?: number;
|
|
48
54
|
}
|
|
49
55
|
/**
|
|
50
56
|
* Check if a given object implements the AgentChatOverviewEntryUio interface.
|
|
@@ -45,6 +45,7 @@ function AgentChatOverviewEntryUioFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
45
45
|
'lastMessageAt': json['lastMessageAt'] == null ? undefined : json['lastMessageAt'],
|
|
46
46
|
'unreadCount': json['unreadCount'],
|
|
47
47
|
'isGenerating': json['isGenerating'],
|
|
48
|
+
'pendingHumanRequests': json['pendingHumanRequests'] == null ? undefined : json['pendingHumanRequests'],
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
function AgentChatOverviewEntryUioToJSON(json) {
|
|
@@ -60,5 +61,6 @@ function AgentChatOverviewEntryUioToJSONTyped(value, ignoreDiscriminator = false
|
|
|
60
61
|
'lastMessageAt': value['lastMessageAt'],
|
|
61
62
|
'unreadCount': value['unreadCount'],
|
|
62
63
|
'isGenerating': value['isGenerating'],
|
|
64
|
+
'pendingHumanRequests': value['pendingHumanRequests'],
|
|
63
65
|
};
|
|
64
66
|
}
|