@breign/client 1.0.138 → 1.0.139

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/openapi.json CHANGED
@@ -8054,6 +8054,206 @@
8054
8054
  "tags" : [ "metrics" ]
8055
8055
  }
8056
8056
  },
8057
+ "/organizations/{organizationId}/tool-approvals" : {
8058
+ "get" : {
8059
+ "description" : "Returns the approvals the CALLER granted in this organisation, newest first. Revoking one deletes it, so every approval returned is a right in force — there is no expiry and no revoked state to filter out. Never another user's: an approval is a personal consent.",
8060
+ "operationId" : "listToolApprovals",
8061
+ "parameters" : [ {
8062
+ "description" : "ID of the organization",
8063
+ "in" : "path",
8064
+ "name" : "organizationId",
8065
+ "required" : true,
8066
+ "schema" : {
8067
+ "type" : "string"
8068
+ }
8069
+ }, {
8070
+ "description" : "Restricts the listing to one agent: its own approvals plus the organisation-wide ones, which apply to it as well. Omitted, everything the caller granted in the organisation.",
8071
+ "in" : "query",
8072
+ "name" : "agentId",
8073
+ "required" : false,
8074
+ "schema" : {
8075
+ "type" : "string"
8076
+ }
8077
+ } ],
8078
+ "responses" : {
8079
+ "200" : {
8080
+ "content" : {
8081
+ "application/json" : {
8082
+ "schema" : {
8083
+ "$ref" : "#/components/schemas/ToolApprovalsResponse"
8084
+ }
8085
+ }
8086
+ },
8087
+ "description" : "Approvals granted by the caller"
8088
+ },
8089
+ "401" : {
8090
+ "description" : "Unauthorized"
8091
+ },
8092
+ "403" : {
8093
+ "description" : "Forbidden"
8094
+ }
8095
+ },
8096
+ "summary" : "List the operations the caller has authorised",
8097
+ "tags" : [ "organizations" ]
8098
+ },
8099
+ "post" : {
8100
+ "description" : "Creates an approval without waiting for the agent to ask for one — preparing an agent rather than answering its questions. It widens no boundary: the value goes through the same validation as an in-conversation approval, the scope is the only one open (this agent, for the caller), and the author is the caller. Granting a value that is already granted returns the existing approval rather than a duplicate.",
8101
+ "operationId" : "createToolApproval",
8102
+ "parameters" : [ {
8103
+ "description" : "ID of the organization",
8104
+ "in" : "path",
8105
+ "name" : "organizationId",
8106
+ "required" : true,
8107
+ "schema" : {
8108
+ "type" : "string"
8109
+ }
8110
+ } ],
8111
+ "requestBody" : {
8112
+ "content" : {
8113
+ "application/json" : {
8114
+ "schema" : {
8115
+ "$ref" : "#/components/schemas/createToolApproval_request"
8116
+ }
8117
+ }
8118
+ },
8119
+ "required" : true
8120
+ },
8121
+ "responses" : {
8122
+ "201" : {
8123
+ "content" : {
8124
+ "application/json" : {
8125
+ "schema" : {
8126
+ "$ref" : "#/components/schemas/ToolApproval"
8127
+ }
8128
+ }
8129
+ },
8130
+ "description" : "Approval granted"
8131
+ },
8132
+ "400" : {
8133
+ "description" : "The value is not valid for that family"
8134
+ },
8135
+ "401" : {
8136
+ "description" : "Unauthorized"
8137
+ },
8138
+ "403" : {
8139
+ "description" : "Forbidden, or no access to that agent"
8140
+ },
8141
+ "404" : {
8142
+ "description" : "No such agent in this organisation"
8143
+ },
8144
+ "503" : {
8145
+ "description" : "Tool approvals are not configured on this deployment"
8146
+ }
8147
+ },
8148
+ "summary" : "Grant an approval by hand",
8149
+ "tags" : [ "organizations" ]
8150
+ }
8151
+ },
8152
+ "/organizations/{organizationId}/tool-approvals/{approvalId}" : {
8153
+ "delete" : {
8154
+ "description" : "Takes back one approval the caller granted. The approval is deleted, and the agent asks again the next time it needs that operation. It takes effect on the agent's next turn.",
8155
+ "operationId" : "revokeToolApproval",
8156
+ "parameters" : [ {
8157
+ "description" : "ID of the organization",
8158
+ "in" : "path",
8159
+ "name" : "organizationId",
8160
+ "required" : true,
8161
+ "schema" : {
8162
+ "type" : "string"
8163
+ }
8164
+ }, {
8165
+ "description" : "Identifier of the approval, as returned by the listing.",
8166
+ "in" : "path",
8167
+ "name" : "approvalId",
8168
+ "required" : true,
8169
+ "schema" : {
8170
+ "type" : "string"
8171
+ }
8172
+ } ],
8173
+ "responses" : {
8174
+ "204" : {
8175
+ "description" : "Approval revoked"
8176
+ },
8177
+ "401" : {
8178
+ "description" : "Unauthorized"
8179
+ },
8180
+ "403" : {
8181
+ "description" : "Forbidden"
8182
+ },
8183
+ "404" : {
8184
+ "description" : "No such approval granted by the caller in this organisation"
8185
+ },
8186
+ "503" : {
8187
+ "description" : "Tool approvals are not configured on this deployment"
8188
+ }
8189
+ },
8190
+ "summary" : "Revoke an approval",
8191
+ "tags" : [ "organizations" ]
8192
+ },
8193
+ "patch" : {
8194
+ "description" : "Rewrites what one approval covers — widening an address into a pattern, or correcting a command. Only an approval the caller granted himself, and only its resource: the scope, the agent and the author never change. An approval cannot be created this way; a right only ever starts with a question the agent actually asked.",
8195
+ "operationId" : "editToolApproval",
8196
+ "parameters" : [ {
8197
+ "description" : "ID of the organization",
8198
+ "in" : "path",
8199
+ "name" : "organizationId",
8200
+ "required" : true,
8201
+ "schema" : {
8202
+ "type" : "string"
8203
+ }
8204
+ }, {
8205
+ "description" : "Identifier of the approval, as returned by the listing.",
8206
+ "in" : "path",
8207
+ "name" : "approvalId",
8208
+ "required" : true,
8209
+ "schema" : {
8210
+ "type" : "string"
8211
+ }
8212
+ } ],
8213
+ "requestBody" : {
8214
+ "content" : {
8215
+ "application/json" : {
8216
+ "schema" : {
8217
+ "$ref" : "#/components/schemas/editToolApproval_request"
8218
+ }
8219
+ }
8220
+ },
8221
+ "required" : true
8222
+ },
8223
+ "responses" : {
8224
+ "200" : {
8225
+ "content" : {
8226
+ "application/json" : {
8227
+ "schema" : {
8228
+ "$ref" : "#/components/schemas/ToolApproval"
8229
+ }
8230
+ }
8231
+ },
8232
+ "description" : "Approval updated"
8233
+ },
8234
+ "400" : {
8235
+ "description" : "The value is not valid for that family"
8236
+ },
8237
+ "401" : {
8238
+ "description" : "Unauthorized"
8239
+ },
8240
+ "403" : {
8241
+ "description" : "Forbidden"
8242
+ },
8243
+ "404" : {
8244
+ "description" : "No such approval granted by the caller in this organisation"
8245
+ },
8246
+ "409" : {
8247
+ "description" : "The caller already granted that exact value in the same scope"
8248
+ },
8249
+ "503" : {
8250
+ "description" : "Tool approvals are not configured on this deployment"
8251
+ }
8252
+ },
8253
+ "summary" : "Edit an approval the caller granted",
8254
+ "tags" : [ "organizations" ]
8255
+ }
8256
+ },
8057
8257
  "/manifests" : {
8058
8258
  "get" : {
8059
8259
  "description" : "Retrieves manifests, filtered by user ID for non-admin users",
@@ -15491,12 +15691,13 @@
15491
15691
  "type" : "object"
15492
15692
  },
15493
15693
  "AgentSandboxNetworkConfiguration" : {
15494
- "description" : "Enables curl inside the sandbox. Without at least one entry in allowedUrlPrefixes the network stays cut. Private address ranges are always denied, server-side.",
15694
+ "description" : "Enables curl inside the sandbox. allowedUrlPrefixes is optional and normally empty: an address that is not listed is submitted to the user, who allows or refuses it in the conversation. It only stays useful where nobody can be asked — an app or a widget — since the network is cut there without a pre-approved entry. Private address ranges are always denied, server-side.",
15495
15695
  "properties" : {
15496
15696
  "enabled" : {
15497
15697
  "type" : "boolean"
15498
15698
  },
15499
15699
  "allowedUrlPrefixes" : {
15700
+ "description" : "Addresses that need no confirmation. Not editable from the agent settings screen: an empty list is the nominal setup, and what the user approves in conversation is stored separately and revoked from the organisation settings.",
15500
15701
  "items" : {
15501
15702
  "description" : "Full origin, path prefix allowed (e.g. https://api.exemple.com/v1/).",
15502
15703
  "type" : "string"
@@ -16690,6 +16891,12 @@
16690
16891
  },
16691
16892
  "type" : "array"
16692
16893
  },
16894
+ "approvals" : {
16895
+ "items" : {
16896
+ "$ref" : "#/components/schemas/ConversationMessageApproval"
16897
+ },
16898
+ "type" : "array"
16899
+ },
16693
16900
  "suggestions" : {
16694
16901
  "items" : {
16695
16902
  "$ref" : "#/components/schemas/Suggestion"
@@ -16802,6 +17009,40 @@
16802
17009
  "required" : [ "code" ],
16803
17010
  "type" : "object"
16804
17011
  },
17012
+ "ConversationMessageApproval" : {
17013
+ "additionalProperties" : false,
17014
+ "description" : "One authorisation decision taken during this message: which tool, over what, by whom, when. Carried by the message so the history reads as it stands, with no extra request. For a decision granted once it is the only lasting trace there is — a one-off creates no standing approval. Deliberately beside toolResults rather than inside it: toolResults is replayed to the model every turn, and a one-off appearing there would later suggest a right that has expired.",
17015
+ "properties" : {
17016
+ "tool" : {
17017
+ "description" : "The tool whose use was submitted for approval. It also says which family the decision belongs to: bash_network_approval an address, bash_python_approval a command.",
17018
+ "type" : "string"
17019
+ },
17020
+ "granted" : {
17021
+ "description" : "Refusals are kept too — deciding not to allow is worth reading back.",
17022
+ "type" : "boolean"
17023
+ },
17024
+ "resource" : {
17025
+ "description" : "What was granted, or on a refusal what had been asked for. An address is the prefix, never the full URL, which can carry a token.",
17026
+ "example" : "https://api.exemple.com/v1",
17027
+ "type" : "string"
17028
+ },
17029
+ "scope" : {
17030
+ "description" : "How far the yes reached. once — this reply only, nothing stored, asked about again next time. agentUser — this agent, for this user, in every conversation, until revoked. Absent on a refusal, which grants nothing.",
17031
+ "enum" : [ "once", "agentUser" ],
17032
+ "type" : "string"
17033
+ },
17034
+ "approvedBy" : {
17035
+ "description" : "Name or email of the person who decided, as it stood when they decided.",
17036
+ "type" : "string"
17037
+ },
17038
+ "at" : {
17039
+ "type" : "string"
17040
+ }
17041
+ },
17042
+ "required" : [ "at", "granted", "resource", "tool" ],
17043
+ "title" : "ConversationMessageApproval",
17044
+ "type" : "object"
17045
+ },
16805
17046
  "Suggestion" : {
16806
17047
  "properties" : {
16807
17048
  "id" : {
@@ -19514,6 +19755,61 @@
19514
19755
  "TotalRequests" : {
19515
19756
  "type" : "number"
19516
19757
  },
19758
+ "ToolApprovalsResponse" : {
19759
+ "additionalProperties" : false,
19760
+ "properties" : {
19761
+ "approvals" : {
19762
+ "items" : {
19763
+ "$ref" : "#/components/schemas/ToolApproval"
19764
+ },
19765
+ "type" : "array"
19766
+ }
19767
+ },
19768
+ "required" : [ "approvals" ],
19769
+ "title" : "ToolApprovalsResponse",
19770
+ "type" : "object"
19771
+ },
19772
+ "ToolApproval" : {
19773
+ "additionalProperties" : false,
19774
+ "description" : "One operation the user has authorised an agent to perform. Two families share this shape: an address the agent sandbox may reach, and a python command it may run. An address is stored normalised — query string, fragment and credentials removed — so a token carried by the URL the user saw is not kept here; a command is stored as it was approved, since the command itself is what was judged.",
19775
+ "properties" : {
19776
+ "id" : {
19777
+ "description" : "Identifier to revoke the approval with.",
19778
+ "type" : "string"
19779
+ },
19780
+ "scopeKind" : {
19781
+ "description" : "What the approval covers. agentUser — this agent, for this user, across all of their conversations — is the only scope stored today. user is still listed because rows stored under it remain in force and readable. A one-off \"allow once\" answer creates no row here at all: it is recorded on the tool call it answered, see ToolCallApproval.",
19782
+ "enum" : [ "agentUser", "user" ],
19783
+ "type" : "string"
19784
+ },
19785
+ "toolName" : {
19786
+ "description" : "The tool the approval applies to. Approvals never cross tools.",
19787
+ "example" : "Bash_exec",
19788
+ "type" : "string"
19789
+ },
19790
+ "resourceKind" : {
19791
+ "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.",
19792
+ "enum" : [ "url", "command", "urlPattern" ],
19793
+ "type" : "string"
19794
+ },
19795
+ "resource" : {
19796
+ "description" : "What is granted, in the family's own notation. A url is a PREFIX: it covers any path below it, with any query parameters. A urlPattern is a GLOB, not a regular expression: a star stands for any text up to the next slash, everything else is literal, the pattern covers the start of the address and is matched case-insensitively. It must start with https://, close its host with a slash, and end with a slash or a star. A command is matched exactly, whitespace aside — a command that differs at all is asked about again.",
19797
+ "example" : "https://api.exemple.com/v1",
19798
+ "type" : "string"
19799
+ },
19800
+ "agentId" : {
19801
+ "description" : "Present on an agentUser-scoped approval.",
19802
+ "type" : "string"
19803
+ },
19804
+ "createdAt" : {
19805
+ "format" : "date-time",
19806
+ "type" : "string"
19807
+ }
19808
+ },
19809
+ "required" : [ "createdAt", "id", "resource", "resourceKind", "scopeKind", "toolName" ],
19810
+ "title" : "ToolApproval",
19811
+ "type" : "object"
19812
+ },
19517
19813
  "Manifest" : {
19518
19814
  "additionalProperties" : true,
19519
19815
  "properties" : {
@@ -21304,14 +21600,14 @@
21304
21600
  },
21305
21601
  "ToolCall" : {
21306
21602
  "additionalProperties" : false,
21307
- "description" : "A tool call whose result does not come from the server. The conversation turn stays suspended until a client posts the result, or until expiresAt passes.",
21603
+ "description" : "A tool call whose result does not come from the server. The conversation turn stays suspended until a client posts the result, or until expiresAt passes when the call carries one.",
21308
21604
  "properties" : {
21309
21605
  "callId" : {
21310
21606
  "description" : "Identifier to post the result to.",
21311
21607
  "type" : "string"
21312
21608
  },
21313
21609
  "tool" : {
21314
- "description" : "Name of the tool the model called.",
21610
+ "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_python_approval is an agent sandbox asking permission to run a python command: 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.",
21315
21611
  "type" : "string"
21316
21612
  },
21317
21613
  "status" : {
@@ -21340,12 +21636,12 @@
21340
21636
  "type" : "string"
21341
21637
  },
21342
21638
  "expiresAt" : {
21343
- "description" : "Past this point the call is expired and the conversation turn is released.",
21639
+ "description" : "Optional, and set tool by tool: a call with no deadline never expires, and none of the tools produced today carries one. When present, past this point the call is expired and the conversation turn is released.",
21344
21640
  "format" : "date-time",
21345
21641
  "type" : "string"
21346
21642
  }
21347
21643
  },
21348
- "required" : [ "callId", "expiresAt", "status", "tool" ],
21644
+ "required" : [ "callId", "status", "tool" ],
21349
21645
  "title" : "ToolCall",
21350
21646
  "type" : "object"
21351
21647
  },
@@ -21372,6 +21668,16 @@
21372
21668
  "error" : {
21373
21669
  "description" : "Failure detail, surfaced to the model when status is failed.",
21374
21670
  "type" : "string"
21671
+ },
21672
+ "approvalScope" : {
21673
+ "description" : "Only read when resolving a bash_network_approval or bash_python_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.",
21674
+ "enum" : [ "once", "agentUser" ],
21675
+ "type" : "string"
21676
+ },
21677
+ "approvalWidth" : {
21678
+ "description" : "Only read when resolving a bash_network_approval call with status completed: how wide the approval is. prefix (the default) grants the prefix shown in the request — origin plus first path segment; origin grants the whole domain. Nothing narrower is offered: nobody can predict the paths an API will serve, and an approval that is too fine is paid for in repeated questions. The server recomputes both from the URL it recorded, so a client cannot submit a prefix of its own. Ignored on a bash_python_approval call, which has a single width: the exact command the server already recorded.",
21679
+ "enum" : [ "prefix", "origin" ],
21680
+ "type" : "string"
21375
21681
  }
21376
21682
  },
21377
21683
  "required" : [ "status" ],
@@ -22930,6 +23236,43 @@
22930
23236
  "required" : [ "success" ],
22931
23237
  "type" : "object"
22932
23238
  },
23239
+ "createToolApproval_request" : {
23240
+ "additionalProperties" : false,
23241
+ "properties" : {
23242
+ "agentId" : {
23243
+ "description" : "The agent the approval is granted to. The caller must have access to it.",
23244
+ "type" : "string"
23245
+ },
23246
+ "resourceKind" : {
23247
+ "enum" : [ "url", "command", "urlPattern" ],
23248
+ "type" : "string"
23249
+ },
23250
+ "resource" : {
23251
+ "description" : "An address is re-normalised server-side (https only, no credentials, no ambiguous separators) and stored as a prefix; a pattern is a glob — a star stands for any text up to the next slash, everything else is literal — that must start with https://, close its host with a slash and end with a slash or a star; a command is stored exactly as written, whitespace normalised.",
23252
+ "maxLength" : 1000,
23253
+ "type" : "string"
23254
+ }
23255
+ },
23256
+ "required" : [ "agentId", "resource", "resourceKind" ],
23257
+ "type" : "object"
23258
+ },
23259
+ "editToolApproval_request" : {
23260
+ "additionalProperties" : false,
23261
+ "properties" : {
23262
+ "resourceKind" : {
23263
+ "description" : "The family the edited value belongs to. Changing it is allowed and is the point: an approved address becomes a pattern this way.",
23264
+ "enum" : [ "url", "command", "urlPattern" ],
23265
+ "type" : "string"
23266
+ },
23267
+ "resource" : {
23268
+ "description" : "The new value. An address is re-normalised server-side (https only, no credentials, no ambiguous separators) and stored as a prefix; a pattern is a glob — a star stands for any text up to the next slash, everything else is literal — that must start with https://, close its host with a slash and end with a slash or a star; a command is stored exactly as written, whitespace normalised.",
23269
+ "maxLength" : 1000,
23270
+ "type" : "string"
23271
+ }
23272
+ },
23273
+ "required" : [ "resource", "resourceKind" ],
23274
+ "type" : "object"
23275
+ },
22933
23276
  "patchKnowledgeBase_request" : {
22934
23277
  "properties" : {
22935
23278
  "name" : {
@@ -23899,6 +24242,12 @@
23899
24242
  },
23900
24243
  "type" : "array"
23901
24244
  },
24245
+ "approvals" : {
24246
+ "items" : {
24247
+ "$ref" : "#/components/schemas/ConversationMessageApproval"
24248
+ },
24249
+ "type" : "array"
24250
+ },
23902
24251
  "workspaceFiles" : {
23903
24252
  "items" : {
23904
24253
  "type" : "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.138",
3
+ "version": "1.0.139",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",