@breign/client 1.0.177 → 1.0.179

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 (43) hide show
  1. package/dist/apis/McpApi.d.ts +33 -0
  2. package/dist/apis/McpApi.js +88 -0
  3. package/dist/apis/ScheduledTasksApi.d.ts +78 -1
  4. package/dist/apis/ScheduledTasksApi.js +192 -0
  5. package/dist/models/AgentBuilderMcpConfigurationUio.d.ts +32 -0
  6. package/dist/models/AgentBuilderMcpConfigurationUio.js +48 -0
  7. package/dist/models/AgentPatchUio.d.ts +7 -0
  8. package/dist/models/AgentPatchUio.js +3 -0
  9. package/dist/models/AgentUio.d.ts +7 -0
  10. package/dist/models/AgentUio.js +3 -0
  11. package/dist/models/ScheduledTaskCreateUio.d.ts +1 -1
  12. package/dist/models/ScheduledTaskRunTriggerUio.d.ts +37 -12
  13. package/dist/models/ScheduledTaskRunTriggerUio.js +21 -34
  14. package/dist/models/ScheduledTaskUio.d.ts +8 -1
  15. package/dist/models/ScheduledTaskUio.js +3 -0
  16. package/dist/models/TaskTriggerUio.d.ts +8 -1
  17. package/dist/models/TaskTriggerUio.js +4 -1
  18. package/dist/models/ToolAllowedToolsRequestUio.d.ts +16 -0
  19. package/dist/models/ToolAllowedToolsRequestUio.js +10 -0
  20. package/dist/models/ToolAllowedToolsResponseUio.d.ts +16 -0
  21. package/dist/models/ToolAllowedToolsResponseUio.js +10 -0
  22. package/dist/models/ToolApprovalUio.d.ts +2 -1
  23. package/dist/models/ToolApprovalUio.js +2 -1
  24. package/dist/models/ToolCallResultRequestUio.d.ts +1 -1
  25. package/dist/models/ToolCallUio.d.ts +1 -1
  26. package/dist/models/ToolSecureMcpUio.d.ts +16 -0
  27. package/dist/models/ToolSecureMcpUio.js +10 -0
  28. package/dist/models/WebhookEndpointUio.d.ts +82 -0
  29. package/dist/models/WebhookEndpointUio.js +84 -0
  30. package/dist/models/WebhookEndpointUpdateUio.d.ts +46 -0
  31. package/dist/models/WebhookEndpointUpdateUio.js +58 -0
  32. package/dist/models/WebhookEventListUio.d.ts +33 -0
  33. package/dist/models/WebhookEventListUio.js +51 -0
  34. package/dist/models/WebhookEventUio.d.ts +87 -0
  35. package/dist/models/WebhookEventUio.js +87 -0
  36. package/dist/models/WebhookTestRequestUio.d.ts +38 -0
  37. package/dist/models/WebhookTestRequestUio.js +50 -0
  38. package/dist/models/WebhookTestResponseUio.d.ts +32 -0
  39. package/dist/models/WebhookTestResponseUio.js +50 -0
  40. package/dist/models/index.d.ts +7 -0
  41. package/dist/models/index.js +7 -0
  42. package/dist/openapi.json +610 -11
  43. package/package.json +1 -1
package/dist/openapi.json CHANGED
@@ -3067,6 +3067,326 @@
3067
3067
  "tags" : [ "scheduledTasks" ]
3068
3068
  }
3069
3069
  },
3070
+ "/agents/{agentId}/scheduled-tasks/{taskId}/webhook" : {
3071
+ "get" : {
3072
+ "operationId" : "getScheduledTaskWebhook",
3073
+ "parameters" : [ {
3074
+ "description" : "ID of the agent",
3075
+ "in" : "path",
3076
+ "name" : "agentId",
3077
+ "required" : true,
3078
+ "schema" : {
3079
+ "format" : "uuid",
3080
+ "type" : "string"
3081
+ }
3082
+ }, {
3083
+ "description" : "ID of the scheduled task",
3084
+ "in" : "path",
3085
+ "name" : "taskId",
3086
+ "required" : true,
3087
+ "schema" : {
3088
+ "type" : "string"
3089
+ }
3090
+ } ],
3091
+ "responses" : {
3092
+ "200" : {
3093
+ "content" : {
3094
+ "application/json" : {
3095
+ "schema" : {
3096
+ "$ref" : "#/components/schemas/WebhookEndpoint"
3097
+ }
3098
+ }
3099
+ },
3100
+ "description" : "The webhook, without its secret"
3101
+ },
3102
+ "401" : {
3103
+ "description" : "Unauthorized"
3104
+ },
3105
+ "403" : {
3106
+ "description" : "Forbidden"
3107
+ },
3108
+ "404" : {
3109
+ "description" : "Task not found, or not triggered by a webhook"
3110
+ }
3111
+ },
3112
+ "summary" : "The webhook of an automation triggered by a webhook",
3113
+ "tags" : [ "scheduledTasks" ]
3114
+ },
3115
+ "patch" : {
3116
+ "operationId" : "updateScheduledTaskWebhook",
3117
+ "parameters" : [ {
3118
+ "description" : "ID of the agent",
3119
+ "in" : "path",
3120
+ "name" : "agentId",
3121
+ "required" : true,
3122
+ "schema" : {
3123
+ "format" : "uuid",
3124
+ "type" : "string"
3125
+ }
3126
+ }, {
3127
+ "description" : "ID of the scheduled task",
3128
+ "in" : "path",
3129
+ "name" : "taskId",
3130
+ "required" : true,
3131
+ "schema" : {
3132
+ "type" : "string"
3133
+ }
3134
+ } ],
3135
+ "requestBody" : {
3136
+ "content" : {
3137
+ "application/json" : {
3138
+ "schema" : {
3139
+ "$ref" : "#/components/schemas/WebhookEndpointUpdate"
3140
+ }
3141
+ }
3142
+ },
3143
+ "required" : true
3144
+ },
3145
+ "responses" : {
3146
+ "200" : {
3147
+ "content" : {
3148
+ "application/json" : {
3149
+ "schema" : {
3150
+ "$ref" : "#/components/schemas/WebhookEndpoint"
3151
+ }
3152
+ }
3153
+ },
3154
+ "description" : "The updated webhook"
3155
+ },
3156
+ "400" : {
3157
+ "description" : "Invalid body"
3158
+ },
3159
+ "401" : {
3160
+ "description" : "Unauthorized"
3161
+ },
3162
+ "403" : {
3163
+ "description" : "Forbidden (another service user requires an organization admin)"
3164
+ },
3165
+ "404" : {
3166
+ "description" : "Task not found, or not triggered by a webhook"
3167
+ },
3168
+ "422" : {
3169
+ "description" : "The service user is not a member of the organization"
3170
+ }
3171
+ },
3172
+ "summary" : "Disable the webhook or change its service user",
3173
+ "tags" : [ "scheduledTasks" ]
3174
+ }
3175
+ },
3176
+ "/agents/{agentId}/scheduled-tasks/{taskId}/webhook/rotate-secret" : {
3177
+ "post" : {
3178
+ "operationId" : "rotateScheduledTaskWebhookSecret",
3179
+ "parameters" : [ {
3180
+ "description" : "ID of the agent",
3181
+ "in" : "path",
3182
+ "name" : "agentId",
3183
+ "required" : true,
3184
+ "schema" : {
3185
+ "format" : "uuid",
3186
+ "type" : "string"
3187
+ }
3188
+ }, {
3189
+ "description" : "ID of the scheduled task",
3190
+ "in" : "path",
3191
+ "name" : "taskId",
3192
+ "required" : true,
3193
+ "schema" : {
3194
+ "type" : "string"
3195
+ }
3196
+ } ],
3197
+ "responses" : {
3198
+ "200" : {
3199
+ "content" : {
3200
+ "application/json" : {
3201
+ "schema" : {
3202
+ "$ref" : "#/components/schemas/WebhookEndpoint"
3203
+ }
3204
+ }
3205
+ },
3206
+ "description" : "The webhook, with its new secret (shown once)"
3207
+ },
3208
+ "401" : {
3209
+ "description" : "Unauthorized"
3210
+ },
3211
+ "403" : {
3212
+ "description" : "Forbidden"
3213
+ },
3214
+ "404" : {
3215
+ "description" : "Task not found, or not triggered by a webhook"
3216
+ }
3217
+ },
3218
+ "summary" : "Rotate the webhook secret (the old one stops working)",
3219
+ "tags" : [ "scheduledTasks" ]
3220
+ }
3221
+ },
3222
+ "/agents/{agentId}/scheduled-tasks/{taskId}/webhook/regenerate-url" : {
3223
+ "post" : {
3224
+ "operationId" : "regenerateScheduledTaskWebhookUrl",
3225
+ "parameters" : [ {
3226
+ "description" : "ID of the agent",
3227
+ "in" : "path",
3228
+ "name" : "agentId",
3229
+ "required" : true,
3230
+ "schema" : {
3231
+ "format" : "uuid",
3232
+ "type" : "string"
3233
+ }
3234
+ }, {
3235
+ "description" : "ID of the scheduled task",
3236
+ "in" : "path",
3237
+ "name" : "taskId",
3238
+ "required" : true,
3239
+ "schema" : {
3240
+ "type" : "string"
3241
+ }
3242
+ } ],
3243
+ "responses" : {
3244
+ "200" : {
3245
+ "content" : {
3246
+ "application/json" : {
3247
+ "schema" : {
3248
+ "$ref" : "#/components/schemas/WebhookEndpoint"
3249
+ }
3250
+ }
3251
+ },
3252
+ "description" : "The webhook at its new URL"
3253
+ },
3254
+ "401" : {
3255
+ "description" : "Unauthorized"
3256
+ },
3257
+ "403" : {
3258
+ "description" : "Forbidden"
3259
+ },
3260
+ "404" : {
3261
+ "description" : "Task not found, or not triggered by a webhook"
3262
+ }
3263
+ },
3264
+ "summary" : "Give the webhook a new URL (the old one answers 404)",
3265
+ "tags" : [ "scheduledTasks" ]
3266
+ }
3267
+ },
3268
+ "/agents/{agentId}/scheduled-tasks/{taskId}/webhook/events" : {
3269
+ "get" : {
3270
+ "operationId" : "listScheduledTaskWebhookEvents",
3271
+ "parameters" : [ {
3272
+ "description" : "ID of the agent",
3273
+ "in" : "path",
3274
+ "name" : "agentId",
3275
+ "required" : true,
3276
+ "schema" : {
3277
+ "format" : "uuid",
3278
+ "type" : "string"
3279
+ }
3280
+ }, {
3281
+ "description" : "ID of the scheduled task",
3282
+ "in" : "path",
3283
+ "name" : "taskId",
3284
+ "required" : true,
3285
+ "schema" : {
3286
+ "type" : "string"
3287
+ }
3288
+ }, {
3289
+ "in" : "query",
3290
+ "name" : "limit",
3291
+ "required" : false,
3292
+ "schema" : {
3293
+ "default" : 20,
3294
+ "maximum" : 100,
3295
+ "minimum" : 1,
3296
+ "type" : "integer"
3297
+ }
3298
+ } ],
3299
+ "responses" : {
3300
+ "200" : {
3301
+ "content" : {
3302
+ "application/json" : {
3303
+ "schema" : {
3304
+ "$ref" : "#/components/schemas/WebhookEventList"
3305
+ }
3306
+ }
3307
+ },
3308
+ "description" : "The latest calls, most recent first"
3309
+ },
3310
+ "401" : {
3311
+ "description" : "Unauthorized"
3312
+ },
3313
+ "403" : {
3314
+ "description" : "Forbidden"
3315
+ },
3316
+ "404" : {
3317
+ "description" : "Task not found, or not triggered by a webhook"
3318
+ }
3319
+ },
3320
+ "summary" : "The latest calls received on the webhook",
3321
+ "tags" : [ "scheduledTasks" ]
3322
+ }
3323
+ },
3324
+ "/agents/{agentId}/scheduled-tasks/{taskId}/webhook/test" : {
3325
+ "post" : {
3326
+ "description" : "The call goes through the same ingestion as a real one, and the agent runs for real.",
3327
+ "operationId" : "testScheduledTaskWebhook",
3328
+ "parameters" : [ {
3329
+ "description" : "ID of the agent",
3330
+ "in" : "path",
3331
+ "name" : "agentId",
3332
+ "required" : true,
3333
+ "schema" : {
3334
+ "format" : "uuid",
3335
+ "type" : "string"
3336
+ }
3337
+ }, {
3338
+ "description" : "ID of the scheduled task",
3339
+ "in" : "path",
3340
+ "name" : "taskId",
3341
+ "required" : true,
3342
+ "schema" : {
3343
+ "type" : "string"
3344
+ }
3345
+ } ],
3346
+ "requestBody" : {
3347
+ "content" : {
3348
+ "application/json" : {
3349
+ "schema" : {
3350
+ "$ref" : "#/components/schemas/WebhookTestRequest"
3351
+ }
3352
+ }
3353
+ },
3354
+ "required" : false
3355
+ },
3356
+ "responses" : {
3357
+ "202" : {
3358
+ "content" : {
3359
+ "application/json" : {
3360
+ "schema" : {
3361
+ "$ref" : "#/components/schemas/WebhookTestResponse"
3362
+ }
3363
+ }
3364
+ },
3365
+ "description" : "The test call is queued"
3366
+ },
3367
+ "400" : {
3368
+ "description" : "Invalid body"
3369
+ },
3370
+ "401" : {
3371
+ "description" : "Unauthorized"
3372
+ },
3373
+ "403" : {
3374
+ "description" : "Forbidden"
3375
+ },
3376
+ "404" : {
3377
+ "description" : "Task not found, or not triggered by a webhook"
3378
+ },
3379
+ "422" : {
3380
+ "description" : "The webhook or the automation is not active"
3381
+ },
3382
+ "429" : {
3383
+ "description" : "Too many calls this minute"
3384
+ }
3385
+ },
3386
+ "summary" : "Send a test call to the webhook, signed by the server",
3387
+ "tags" : [ "scheduledTasks" ]
3388
+ }
3389
+ },
3070
3390
  "/agents/{agentId}/apps" : {
3071
3391
  "get" : {
3072
3392
  "description" : "Get apps for agent id",
@@ -6154,6 +6474,85 @@
6154
6474
  "tags" : [ "mcp" ]
6155
6475
  }
6156
6476
  },
6477
+ "/mcp/builder" : {
6478
+ "delete" : {
6479
+ "description" : "Aucune session à clore : le transport est sans état.",
6480
+ "operationId" : "deleteBuilderMcpSession",
6481
+ "responses" : {
6482
+ "405" : {
6483
+ "content" : {
6484
+ "application/json" : {
6485
+ "schema" : {
6486
+ "$ref" : "#/components/schemas/McpJsonRpcResponse"
6487
+ }
6488
+ }
6489
+ },
6490
+ "description" : "Method not allowed"
6491
+ }
6492
+ },
6493
+ "summary" : "Not supported (stateless MCP server)",
6494
+ "tags" : [ "mcp" ]
6495
+ },
6496
+ "get" : {
6497
+ "description" : "Pas de flux SSE côté serveur : le transport est sans état.",
6498
+ "operationId" : "getBuilderMcpStream",
6499
+ "responses" : {
6500
+ "405" : {
6501
+ "content" : {
6502
+ "application/json" : {
6503
+ "schema" : {
6504
+ "$ref" : "#/components/schemas/McpJsonRpcResponse"
6505
+ }
6506
+ }
6507
+ },
6508
+ "description" : "Method not allowed"
6509
+ }
6510
+ },
6511
+ "summary" : "Not supported (stateless MCP server)",
6512
+ "tags" : [ "mcp" ]
6513
+ },
6514
+ "post" : {
6515
+ "description" : "Serveur MCP (Model Context Protocol, transport Streamable HTTP, sans état) qui crée et édite les agents des organisations de l'utilisateur : de quoi brancher Claude Code, ou tout client MCP, sur la configuration de Breign. Lié à la clé et non à une organisation : chaque outil vérifie que l'utilisateur est membre de celle qu'il touche. Distinct du serveur `/organizations/{organizationId}/mcp`, qui ne sert qu'à interroger les agents : brancher l'un ne donne pas les droits d'écriture de l'autre.\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. Chaque action est faite au nom du propriétaire de la clé, avec ses droits.\n\nOutils exposés — lecture :\n- `list_organizations` — organisations dont l'utilisateur est membre.\n- `list_agents` `{ organizationId }` — agents de l'organisation.\n- `get_agent` `{ agentId }` — configuration d'un agent : textes, moteur, skills et bases de\n connaissance rattachés.\n\n- `list_engines` `{ organizationId }` — providers de l'organisation et leurs modèles.\n- `list_skills` `{ organizationId }` — skills de l'organisation.\n- `list_knowledge_bases` `{ organizationId }` — bases de connaissance de l'organisation.\n\nOutils exposés — écriture (jamais de suppression ni de détachement) :\n- `create_agent` `{ organizationId, name, persona, promptInit?, description?, role?,\n defaultLanguage? }`.\n\n- `update_agent` `{ agentId, name?, description?, role?, defaultLanguage?, persona?,\n promptInit?, isActivated? }` — `null` ou absent : champ inchangé.\n\n- `set_agent_engine` `{ agentId, providerId, model }`.\n- `attach_skill` `{ agentId, skillId }` — ajoute un skill, sans retirer les autres.\n- `attach_knowledge_base` `{ agentId, knowledgeBaseId }` — ajoute une base, sans retirer les\n autres.\n\n\nUn agent Breign dont `builderMcpConfiguration.enabled` est vrai reçoit les mêmes outils, au nom de l'utilisateur de la conversation, bornés à l'organisation de l'agent (ni `list_organizations` ni `organizationId`) ; chaque écriture lui demande alors son approbation.\n\nConfiguration d'un client, par exemple Claude Code : `claude mcp add --transport http breign-builder https://<api>/mcp/builder --header \"Authorization: Bearer ai-…\"`. Le client doit accepter `application/json` et `text/event-stream` (header `Accept`).",
6516
+ "operationId" : "handleBuilderMcpRequest",
6517
+ "requestBody" : {
6518
+ "content" : {
6519
+ "application/json" : {
6520
+ "schema" : {
6521
+ "$ref" : "#/components/schemas/McpJsonRpcRequest"
6522
+ }
6523
+ }
6524
+ },
6525
+ "required" : true
6526
+ },
6527
+ "responses" : {
6528
+ "200" : {
6529
+ "content" : {
6530
+ "application/json" : {
6531
+ "schema" : {
6532
+ "$ref" : "#/components/schemas/McpJsonRpcResponse"
6533
+ }
6534
+ }
6535
+ },
6536
+ "description" : "Réponse JSON-RPC"
6537
+ },
6538
+ "202" : {
6539
+ "description" : "Notification acceptée, sans corps"
6540
+ },
6541
+ "401" : {
6542
+ "content" : {
6543
+ "application/json" : {
6544
+ "schema" : {
6545
+ "$ref" : "#/components/schemas/McpJsonRpcResponse"
6546
+ }
6547
+ }
6548
+ },
6549
+ "description" : "Clé API personnelle requise"
6550
+ }
6551
+ },
6552
+ "summary" : "Builder MCP server",
6553
+ "tags" : [ "mcp" ]
6554
+ }
6555
+ },
6157
6556
  "/conversations/{conversationId}/read" : {
6158
6557
  "post" : {
6159
6558
  "description" : "Positionne la marque de lecture de l'utilisateur sur la conversation.",
@@ -21282,6 +21681,12 @@
21282
21681
  } ],
21283
21682
  "nullable" : true
21284
21683
  },
21684
+ "builderMcpConfiguration" : {
21685
+ "allOf" : [ {
21686
+ "$ref" : "#/components/schemas/AgentBuilderMcpConfiguration"
21687
+ } ],
21688
+ "nullable" : true
21689
+ },
21285
21690
  "humanEscalationConfiguration" : {
21286
21691
  "allOf" : [ {
21287
21692
  "$ref" : "#/components/schemas/AgentHumanEscalationConfiguration"
@@ -21528,6 +21933,16 @@
21528
21933
  },
21529
21934
  "type" : "object"
21530
21935
  },
21936
+ "AgentBuilderMcpConfiguration" : {
21937
+ "description" : "Access to Breign's builder MCP server (create and edit the organisation's agents) from inside a conversation, acting as the user of that conversation. Opt-in; only an organisation admin can change it. Every write the agent makes through it asks the user for approval first.",
21938
+ "properties" : {
21939
+ "enabled" : {
21940
+ "description" : "Gives this agent the builder tools.",
21941
+ "type" : "boolean"
21942
+ }
21943
+ },
21944
+ "type" : "object"
21945
+ },
21531
21946
  "AgentHumanEscalationConfiguration" : {
21532
21947
  "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.",
21533
21948
  "properties" : {
@@ -21760,6 +22175,12 @@
21760
22175
  } ],
21761
22176
  "nullable" : true
21762
22177
  },
22178
+ "builderMcpConfiguration" : {
22179
+ "allOf" : [ {
22180
+ "$ref" : "#/components/schemas/AgentBuilderMcpConfiguration"
22181
+ } ],
22182
+ "nullable" : true
22183
+ },
21763
22184
  "humanEscalationConfiguration" : {
21764
22185
  "allOf" : [ {
21765
22186
  "$ref" : "#/components/schemas/AgentHumanEscalationConfiguration"
@@ -23339,12 +23760,15 @@
23339
23760
  "allOf" : [ {
23340
23761
  "$ref" : "#/components/schemas/TaskSchedule"
23341
23762
  } ],
23342
- "description" : "null for an automation triggered by an event.",
23763
+ "description" : "null for an automation triggered by an event or a webhook.",
23343
23764
  "nullable" : true
23344
23765
  },
23345
23766
  "trigger" : {
23346
23767
  "$ref" : "#/components/schemas/TaskTrigger"
23347
23768
  },
23769
+ "webhook" : {
23770
+ "$ref" : "#/components/schemas/WebhookEndpoint"
23771
+ },
23348
23772
  "cronExpression" : {
23349
23773
  "type" : "string"
23350
23774
  },
@@ -23446,10 +23870,14 @@
23446
23870
  "type" : "object"
23447
23871
  },
23448
23872
  "TaskTrigger" : {
23449
- "description" : "What starts the automation. `schedule` (default): its schedule. `event`: a mention of one of the bot accounts in GitLab, in the given kinds of objects and projects (empty: all projects; `groupe/projet` or `groupe/*`).",
23873
+ "description" : "What starts the automation. `schedule` (default): its schedule. `event`: a mention of one of the bot accounts in GitLab, in the given kinds of objects and projects (empty: all projects; `groupe/projet` or `groupe/*`). `webhook`: a call to its webhook (see `ScheduledTask.webhook`); the result goes to `callbackUrl`.",
23450
23874
  "properties" : {
23451
23875
  "type" : {
23452
- "enum" : [ "schedule", "event" ],
23876
+ "enum" : [ "schedule", "event", "webhook" ],
23877
+ "type" : "string"
23878
+ },
23879
+ "runAsUserId" : {
23880
+ "description" : "`webhook` only, on create or update: the member the conversations run as (default: the caller; another member requires an organization admin). Not stored on the task.",
23453
23881
  "type" : "string"
23454
23882
  },
23455
23883
  "source" : {
@@ -23483,7 +23911,7 @@
23483
23911
  "type" : "object"
23484
23912
  },
23485
23913
  "ScheduledTaskCreate" : {
23486
- "description" : "`schedule` is required unless `trigger.type` is `event` (then `mode` must be `recurring`).",
23914
+ "description" : "`schedule` is required unless `trigger.type` is `event` or `webhook` (then `mode` must be `recurring`). A `webhook` trigger creates the webhook, returned in `webhook` with its secret (shown once).",
23487
23915
  "properties" : {
23488
23916
  "message" : {
23489
23917
  "minLength" : 1,
@@ -23654,15 +24082,31 @@
23654
24082
  "type" : "object"
23655
24083
  },
23656
24084
  "ScheduledTaskRunTrigger" : {
23657
- "description" : "The GitLab mention that triggered a run.",
24085
+ "description" : "The external event that triggered a run: a GitLab mention (`source: gitlab`, GitLab fields set) or a webhook call (`source: webhook`: `thread`, `contentType`, `payload`).",
23658
24086
  "properties" : {
23659
24087
  "eventId" : {
23660
24088
  "type" : "string"
23661
24089
  },
23662
24090
  "source" : {
23663
- "enum" : [ "gitlab" ],
24091
+ "enum" : [ "gitlab", "webhook" ],
24092
+ "type" : "string"
24093
+ },
24094
+ "thread" : {
24095
+ "description" : "webhook only — the `X-Breign-Thread` of the call.",
24096
+ "nullable" : true,
23664
24097
  "type" : "string"
23665
24098
  },
24099
+ "contentType" : {
24100
+ "description" : "webhook only.",
24101
+ "type" : "string"
24102
+ },
24103
+ "payload" : {
24104
+ "description" : "webhook only — the body received (untrusted caller data), or its start as text."
24105
+ },
24106
+ "payloadTruncated" : {
24107
+ "description" : "webhook only.",
24108
+ "type" : "boolean"
24109
+ },
23666
24110
  "status" : {
23667
24111
  "$ref" : "#/components/schemas/ExternalEventStatus"
23668
24112
  },
@@ -23719,7 +24163,138 @@
23719
24163
  "type" : "string"
23720
24164
  }
23721
24165
  },
23722
- "required" : [ "author", "body", "botUsername", "conversationId", "eventId", "noteUrl", "projectPath", "receivedAt", "replyUrl", "routing", "source", "status", "targetIid", "targetTitle", "targetType", "targetUrl" ],
24166
+ "required" : [ "conversationId", "eventId", "receivedAt", "source", "status" ],
24167
+ "type" : "object"
24168
+ },
24169
+ "WebhookEndpoint" : {
24170
+ "description" : "The public address of an automation triggered by a webhook. Callers POST to `url` with `Authorization: Bearer <secret>`, or sign the raw body with HMAC-SHA256 (`X-Breign-Signature: sha256=<hex>`; with `X-Breign-Timestamp: <unix seconds>` the signature covers `<timestamp>.<body>`). Optional headers: `Idempotency-Key`, `X-Breign-Thread`.",
24171
+ "properties" : {
24172
+ "id" : {
24173
+ "type" : "string"
24174
+ },
24175
+ "url" : {
24176
+ "type" : "string"
24177
+ },
24178
+ "status" : {
24179
+ "enum" : [ "active", "disabled" ],
24180
+ "type" : "string"
24181
+ },
24182
+ "runAsUserId" : {
24183
+ "description" : "The organization member the conversations run as (user-scoped MCP tools, quotas, history).",
24184
+ "type" : "string"
24185
+ },
24186
+ "lastEventAt" : {
24187
+ "format" : "date-time",
24188
+ "nullable" : true,
24189
+ "type" : "string"
24190
+ },
24191
+ "createdAt" : {
24192
+ "format" : "date-time",
24193
+ "type" : "string"
24194
+ },
24195
+ "updatedAt" : {
24196
+ "format" : "date-time",
24197
+ "type" : "string"
24198
+ },
24199
+ "secret" : {
24200
+ "description" : "Only returned when the endpoint is created and after a rotation.",
24201
+ "type" : "string"
24202
+ }
24203
+ },
24204
+ "required" : [ "createdAt", "id", "lastEventAt", "runAsUserId", "status", "updatedAt", "url" ],
24205
+ "type" : "object"
24206
+ },
24207
+ "WebhookEndpointUpdate" : {
24208
+ "minProperties" : 1,
24209
+ "properties" : {
24210
+ "runAsUserId" : {
24211
+ "description" : "Another member than the caller requires an organization admin.",
24212
+ "type" : "string"
24213
+ },
24214
+ "status" : {
24215
+ "enum" : [ "active", "disabled" ],
24216
+ "type" : "string"
24217
+ }
24218
+ },
24219
+ "type" : "object"
24220
+ },
24221
+ "WebhookEventList" : {
24222
+ "properties" : {
24223
+ "events" : {
24224
+ "items" : {
24225
+ "$ref" : "#/components/schemas/WebhookEvent"
24226
+ },
24227
+ "type" : "array"
24228
+ }
24229
+ },
24230
+ "required" : [ "events" ],
24231
+ "type" : "object"
24232
+ },
24233
+ "WebhookEvent" : {
24234
+ "description" : "A call received on the webhook, and where it is in the queue.",
24235
+ "properties" : {
24236
+ "id" : {
24237
+ "type" : "string"
24238
+ },
24239
+ "status" : {
24240
+ "$ref" : "#/components/schemas/ExternalEventStatus"
24241
+ },
24242
+ "receivedAt" : {
24243
+ "format" : "date-time",
24244
+ "type" : "string"
24245
+ },
24246
+ "finishedAt" : {
24247
+ "format" : "date-time",
24248
+ "nullable" : true,
24249
+ "type" : "string"
24250
+ },
24251
+ "attempts" : {
24252
+ "type" : "integer"
24253
+ },
24254
+ "lastError" : {
24255
+ "nullable" : true,
24256
+ "type" : "string"
24257
+ },
24258
+ "thread" : {
24259
+ "nullable" : true,
24260
+ "type" : "string"
24261
+ },
24262
+ "contentType" : {
24263
+ "type" : "string"
24264
+ },
24265
+ "runId" : {
24266
+ "nullable" : true,
24267
+ "type" : "string"
24268
+ },
24269
+ "conversationId" : {
24270
+ "nullable" : true,
24271
+ "type" : "string"
24272
+ }
24273
+ },
24274
+ "required" : [ "attempts", "contentType", "conversationId", "finishedAt", "id", "lastError", "receivedAt", "runId", "status", "thread" ],
24275
+ "type" : "object"
24276
+ },
24277
+ "WebhookTestRequest" : {
24278
+ "properties" : {
24279
+ "body" : {
24280
+ "description" : "The JSON body of the test call (default `{\"test\": true}`)."
24281
+ },
24282
+ "thread" : {
24283
+ "description" : "Sent as `X-Breign-Thread`.",
24284
+ "maxLength" : 200,
24285
+ "type" : "string"
24286
+ }
24287
+ },
24288
+ "type" : "object"
24289
+ },
24290
+ "WebhookTestResponse" : {
24291
+ "properties" : {
24292
+ "eventId" : {
24293
+ "nullable" : true,
24294
+ "type" : "string"
24295
+ }
24296
+ },
24297
+ "required" : [ "eventId" ],
23723
24298
  "type" : "object"
23724
24299
  },
23725
24300
  "AppLight" : {
@@ -26908,8 +27483,8 @@
26908
27483
  "type" : "string"
26909
27484
  },
26910
27485
  "resourceKind" : {
26911
- "description" : "Which family the approval belongs to. url is an address the agent sandbox may reach; urlPattern is a glob covering a whole site, subdomains included; command is one exact command line it may run.",
26912
- "enum" : [ "url", "command", "urlPattern" ],
27486
+ "description" : "Which family the approval belongs to. url is an address the agent sandbox may reach; urlPattern is a glob covering a whole site, subdomains included; command is one exact command line it may run; mcpTool is an MCP tool that writes, as server/tool (for example builder/update_agent), whatever its arguments — stored under toolName mcp. An mcpTool approval is only ever born of a question the agent asked: it cannot be created or edited by hand.",
27487
+ "enum" : [ "url", "command", "urlPattern", "mcpTool" ],
26913
27488
  "type" : "string"
26914
27489
  },
26915
27490
  "resource" : {
@@ -27629,6 +28204,14 @@
27629
28204
  },
27630
28205
  "type" : "array",
27631
28206
  "uniqueItems" : true
28207
+ },
28208
+ "approvalModes" : {
28209
+ "additionalProperties" : {
28210
+ "enum" : [ "always", "never" ],
28211
+ "type" : "string"
28212
+ },
28213
+ "description" : "Quand un appel de l'outil demande l'approbation de l'utilisateur, par nom d'outil. Absent : automatique — demandée sauf si le serveur déclare l'outil en lecture seule (readOnlyHint). always : toujours demander, et refuser l'appel quand personne ne peut répondre (tâche planifiée, widget, appel entre agents). never : ne jamais demander.",
28214
+ "type" : "object"
27632
28215
  }
27633
28216
  },
27634
28217
  "required" : [ "allowedTools" ],
@@ -27643,6 +28226,14 @@
27643
28226
  "type" : "string"
27644
28227
  },
27645
28228
  "type" : "array"
28229
+ },
28230
+ "approvalModes" : {
28231
+ "additionalProperties" : {
28232
+ "enum" : [ "always", "never" ],
28233
+ "type" : "string"
28234
+ },
28235
+ "description" : "Quand un appel de l'outil demande l'approbation de l'utilisateur, par nom d'outil. Absent : automatique — demandée sauf si le serveur déclare l'outil en lecture seule (readOnlyHint). always : toujours demander, et refuser l'appel quand personne ne peut répondre (tâche planifiée, widget, appel entre agents). never : ne jamais demander.",
28236
+ "type" : "object"
27646
28237
  }
27647
28238
  },
27648
28239
  "required" : [ "allowedTools" ],
@@ -29066,7 +29657,7 @@
29066
29657
  "type" : "string"
29067
29658
  },
29068
29659
  "tool" : {
29069
- "description" : "Name of the tool the model called. Three values are produced by the server today. take_screenshot asks the client to capture the screen. bash_network_approval is an agent sandbox asking permission to reach an address: arguments carries url (the full address, to be shown as-is), urlPrefix (what a yes actually grants), origin, host and method. bash_command_approval is an agent sandbox asking permission to run a command through one of its interpreters — python3 or js-exec: arguments carries command, which is both what has to be shown in full and exactly what a yes grants — nothing ran, so a refusal leaves the sandbox untouched. Calls named bash_python_approval, the name this last one carried while python was the only interpreter, may still be waiting in older conversations and resolve exactly the same way.",
29660
+ "description" : "Name of the tool the model called. Four values are produced by the server today. mcp_tool_approval asks permission to run an MCP tool: a write of the builder server, which creates and edits agents, or a tool of an MCP server configured in the organisation, by its approval mode (see Tool.mcp.approvalModes). arguments carries server (builder, or the id of the organisation's tool), serverName (the name to show), tool and arguments (the exact call the model wants to make), and — builder only — preview — what the call changes, for display only: tool, agentName, changes (field, before when something existed, after, with names instead of ids, unchanged fields left out) and warnings (deactivates, rewritesInstructions, changesEngine); null when it could not be built. Allow once covers exactly these arguments; agentUser covers the tool whatever its arguments. take_screenshot asks the client to capture the screen. bash_network_approval is an agent sandbox asking permission to reach an address: arguments carries url (the full address, to be shown as-is), urlPrefix (what a yes actually grants), origin, host and method. bash_command_approval is an agent sandbox asking permission to run a command through one of its interpreters — python3 or js-exec: arguments carries command, which is both what has to be shown in full and exactly what a yes grants — nothing ran, so a refusal leaves the sandbox untouched. Calls named bash_python_approval, the name this last one carried while python was the only interpreter, may still be waiting in older conversations and resolve exactly the same way.",
29070
29661
  "type" : "string"
29071
29662
  },
29072
29663
  "status" : {
@@ -29129,7 +29720,7 @@
29129
29720
  "type" : "string"
29130
29721
  },
29131
29722
  "approvalScope" : {
29132
- "description" : "Only read when resolving a bash_network_approval or bash_command_approval call with status completed: how far the approval reaches. once — the suspended reply and nothing after it, so the same request is asked about again next time — is the default, and nothing is stored. agentUser covers this agent, for this user, across all of their conversations, and is kept until revoked. Any other value is refused with a 400. Never widens what the agent is allowed to do: the server-side lock and the per-agent switch remain prerequisites. Only the user the question was asked of may answer it: an approval is a personal consent, so another caller — an admin included — gets a 403.",
29723
+ "description" : "Only read when resolving a bash_network_approval, bash_command_approval or mcp_tool_approval call with status completed: how far the approval reaches. once — the suspended reply and nothing after it, so the same request is asked about again next time — is the default, and nothing is stored. agentUser covers this agent, for this user, across all of their conversations, and is kept until revoked. Any other value is refused with a 400. Never widens what the agent is allowed to do: the server-side lock and the per-agent switch remain prerequisites. Only the user the question was asked of may answer it: an approval is a personal consent, so another caller — an admin included — gets a 403.",
29133
29724
  "enum" : [ "once", "agentUser" ],
29134
29725
  "type" : "string"
29135
29726
  },
@@ -34689,6 +35280,14 @@
34689
35280
  "type" : "string"
34690
35281
  },
34691
35282
  "type" : "array"
35283
+ },
35284
+ "approvalModes" : {
35285
+ "additionalProperties" : {
35286
+ "enum" : [ "always", "never" ],
35287
+ "type" : "string"
35288
+ },
35289
+ "description" : "Quand un appel de l'outil demande l'approbation de l'utilisateur, par nom d'outil. Absent : automatique — demandée sauf si le serveur déclare l'outil en lecture seule (readOnlyHint). always : toujours demander, et refuser l'appel quand personne ne peut répondre (tâche planifiée, widget, appel entre agents). never : ne jamais demander.",
35290
+ "type" : "object"
34692
35291
  }
34693
35292
  },
34694
35293
  "type" : "object"