Skip to content

Commit 12e804d

Browse files
authored
API: name each Bot's owner on the admin list of every Bot (#2808)
* API: name each Bot's owner on the admin list of every Bot listBots with scope=organization lists every person's own copy of a starter Bot under the same name, so an admin's screens show rows like six General Assistants with nothing saying whose each one is. Add an optional, read-only owner (id, name, email, image) to Bot, present on that list only, for every Bot a person owns, and absent on ownerless Bots and from older servers. Additive: a new optional response field and a new schema; oasdiff reports nothing breaking. Regenerated the web and phone clients. * API: the organization example sends a withheld Bot without its packageBotId, as the server does
1 parent 3d2df58 commit 12e804d

11 files changed

Lines changed: 494 additions & 21 deletions

File tree

‎api/openapi.yaml‎

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ paths:
210210
- Bots
211211
operationId: listBots
212212
summary: List Bots
213-
description: 'Return one page of the Bots the caller can see: theirs, the ones shared with them, the ones assigned to them and the ones that come with OpenBot, oldest first, and by id among Bots made at the same moment. Somebody else''s private Bot is never among them, an admin''s list included. hidden=true lists only the Bots the caller hid from their own list instead. scope=organization lists every Bot in the organization, people''s private Bots included, for an admin''s screens that decide what Bots may hold; it is refused to anybody who is not an admin of the organization. Somebody else''s private Bot comes withheld there: its name and avatar, and nothing from inside it (see the Bot''s withheld). A missing cursor starts at the first page and nextCursor null ends the list.'
213+
description: 'Return one page of the Bots the caller can see: theirs, the ones shared with them, the ones assigned to them and the ones that come with OpenBot, oldest first, and by id among Bots made at the same moment. Somebody else''s private Bot is never among them, an admin''s list included. hidden=true lists only the Bots the caller hid from their own list instead. scope=organization lists every Bot in the organization, people''s private Bots included, for an admin''s screens that decide what Bots may hold; it is refused to anybody who is not an admin of the organization. Somebody else''s private Bot comes withheld there: its name and avatar, and nothing from inside it (see the Bot''s withheld). Every Bot a person owns comes with its owner there (see the Bot''s owner). A missing cursor starts at the first page and nextCursor null ends the list.'
214214
security:
215215
- webSession: []
216216
- appOAuth:
@@ -249,6 +249,8 @@ paths:
249249
examples:
250250
lastPage:
251251
$ref: '#/components/examples/BotPageLast'
252+
organization:
253+
$ref: '#/components/examples/BotPageOrganization'
252254
'400':
253255
$ref: '#/components/responses/InvalidRequest'
254256
'401':
@@ -30355,9 +30357,13 @@ components:
3035530357
mine:
3035630358
type: boolean
3035730359
description: Whether the caller created it. Separate from canManage, which is also true for an administrator on everybody's Bots.
30360+
owner:
30361+
$ref: '#/components/schemas/BotOwner'
30362+
readOnly: true
30363+
description: The person who owns it, on listBots with scope=organization only, so an admin's screens can tell one person's Bot from another's of the same name (each person's own copy of a Bot OpenBot starts with, for one). Absent on a Bot nobody owns (see ownerless), on every other list and read, and from a server older than this field, where a client names the Bot alone. Never accepted when a Bot is created or changed.
3035830364
withheld:
3035930365
type: boolean
30360-
description: 'Whether it is somebody else''s private Bot, listed for an admin''s screens (listBots with scope=organization) and nothing more. Such a Bot carries its id, name, avatar and the caller''s own state with it only: title and roleDescription are empty, endpoint is null, instructions and framework are absent, hasAuth, hasCallbackToken, isolated, builtIn, runsOnOpenBotModel, keyFromOpenBot and canManage are false. Absent or false on every other Bot.'
30366+
description: 'Whether it is somebody else''s private Bot, listed for an admin''s screens (listBots with scope=organization) and nothing more. Such a Bot carries its id, name, avatar, owner and the caller''s own state with it only: title and roleDescription are empty, endpoint is null, instructions and framework are absent, hasAuth, hasCallbackToken, isolated, builtIn, runsOnOpenBotModel, keyFromOpenBot and canManage are false. Absent or false on every other Bot.'
3036130367
assignedToMe:
3036230368
type: boolean
3036330369
description: Whether an administrator assigned this Bot to the caller.
@@ -33352,6 +33358,31 @@ components:
3335233358
minLength: 1
3335333359
maxLength: 320
3335433360
pattern: \S
33361+
BotOwner:
33362+
type: object
33363+
description: 'The person a Bot belongs to, as an admin''s screens name them: what OpenBot calls them, the address they sign in with, and their picture.'
33364+
required:
33365+
- id
33366+
- name
33367+
- email
33368+
- image
33369+
properties:
33370+
id:
33371+
type: string
33372+
description: The person's id.
33373+
name:
33374+
type:
33375+
- string
33376+
- 'null'
33377+
description: What OpenBot calls them. Null when nothing has named them.
33378+
email:
33379+
type: string
33380+
description: The address they sign in with.
33381+
image:
33382+
type:
33383+
- string
33384+
- 'null'
33385+
description: The picture their identity provider gave, when it gave one.
3335533386
BotName:
3335633387
type: string
3335733388
minLength: 1
@@ -59414,6 +59445,67 @@ components:
5941459445
value:
5941559446
model: gpt-6.1-pro
5941659447
effort: xhigh
59448+
BotPageOrganization:
59449+
summary: 'Every Bot in the organization, for an admin: two people''s own copies of the same Bot, each named with its owner.'
59450+
value:
59451+
bots:
59452+
- id: 7c1e2a90-5d3b-4f6e-9a18-2b4c6d8e0f13
59453+
name: General Assistant
59454+
title: Everyday Work
59455+
roleDescription: Help with everyday work using clear, concise, and accurate answers.
59456+
avatarSeed: general-assistant
59457+
visibility: private
59458+
hidden: false
59459+
pinned: false
59460+
systemOwned: false
59461+
packageBotId: general-assistant
59462+
endpoint: null
59463+
hasAuth: false
59464+
hasCallbackToken: false
59465+
isolated: false
59466+
framework: OpenBot
59467+
canManage: true
59468+
mine: true
59469+
owner:
59470+
id: user_2b8kq4
59471+
name: Ada Okafor
59472+
email: ada@example.com
59473+
image: null
59474+
assignedToMe: false
59475+
builtIn: true
59476+
runsOnOpenBotModel: true
59477+
keyFromOpenBot: true
59478+
isolationActive: false
59479+
isolationOffReason: null
59480+
- id: 3f9d4b21-8e6a-4c07-b2d5-91a7e3c0f468
59481+
name: General Assistant
59482+
title: ''
59483+
roleDescription: ''
59484+
avatarSeed: general-assistant
59485+
visibility: private
59486+
hidden: false
59487+
pinned: false
59488+
systemOwned: false
59489+
packageBotId: null
59490+
endpoint: null
59491+
hasAuth: false
59492+
hasCallbackToken: false
59493+
isolated: false
59494+
canManage: false
59495+
mine: false
59496+
withheld: true
59497+
owner:
59498+
id: user_7h3mz1
59499+
name: Sam Rivera
59500+
email: sam@example.com
59501+
image: https://images.example.com/sam.png
59502+
assignedToMe: false
59503+
builtIn: false
59504+
runsOnOpenBotModel: false
59505+
keyFromOpenBot: false
59506+
isolationActive: false
59507+
isolationOffReason: null
59508+
nextCursor: null
5941759509
ServiceTermsToAgreeExample:
5941859510
summary: OpenBot Cloud, for somebody who hasn't agreed yet.
5941959511
value:

‎api/openapi/bots.yaml‎

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ paths:
2121
Bots may hold; it is refused to anybody who is not an admin of the
2222
organization. Somebody else's private Bot comes withheld there: its
2323
name and avatar, and nothing from inside it (see the Bot's withheld).
24-
A missing cursor starts at the first page and nextCursor null ends the
24+
Every Bot a person owns comes with its owner there (see the Bot's
25+
owner). A missing cursor starts at the first page and nextCursor null ends the
2526
list.
2627
security:
2728
- webSession: []
@@ -60,6 +61,8 @@ paths:
6061
examples:
6162
lastPage:
6263
$ref: '#/components/examples/BotPageLast'
64+
organization:
65+
$ref: '#/components/examples/BotPageOrganization'
6366
'400':
6467
$ref: './common.yaml#/components/responses/InvalidRequest'
6568
'401':
@@ -1767,13 +1770,24 @@ components:
17671770
description: >-
17681771
Whether the caller created it. Separate from canManage, which is
17691772
also true for an administrator on everybody's Bots.
1773+
owner:
1774+
$ref: '#/components/schemas/BotOwner'
1775+
readOnly: true
1776+
description: >-
1777+
The person who owns it, on listBots with scope=organization only,
1778+
so an admin's screens can tell one person's Bot from another's of
1779+
the same name (each person's own copy of a Bot OpenBot starts
1780+
with, for one). Absent on a Bot nobody owns (see ownerless), on
1781+
every other list and read, and from a server older than this
1782+
field, where a client names the Bot alone. Never accepted when a
1783+
Bot is created or changed.
17701784
withheld:
17711785
type: boolean
17721786
description: >-
17731787
Whether it is somebody else's private Bot, listed for an admin's
17741788
screens (listBots with scope=organization) and nothing more. Such
1775-
a Bot carries its id, name, avatar and the caller's own state with
1776-
it only: title and roleDescription are empty, endpoint is null,
1789+
a Bot carries its id, name, avatar, owner and the caller's own
1790+
state with it only: title and roleDescription are empty, endpoint is null,
17771791
instructions and framework are absent, hasAuth, hasCallbackToken,
17781792
isolated, builtIn, runsOnOpenBotModel, keyFromOpenBot and canManage
17791793
are false. Absent or false on every other Bot.
@@ -1825,6 +1839,25 @@ components:
18251839
Why an isolated Bot runs on a shared computer instead. admin: its
18261840
owner no longer holds Isolated Bots. deployment: this deployment
18271841
cannot make another computer. Null otherwise.
1842+
BotOwner:
1843+
type: object
1844+
description: >-
1845+
The person a Bot belongs to, as an admin's screens name them: what
1846+
OpenBot calls them, the address they sign in with, and their picture.
1847+
required: [id, name, email, image]
1848+
properties:
1849+
id:
1850+
type: string
1851+
description: The person's id.
1852+
name:
1853+
type: [string, 'null']
1854+
description: What OpenBot calls them. Null when nothing has named them.
1855+
email:
1856+
type: string
1857+
description: The address they sign in with.
1858+
image:
1859+
type: [string, 'null']
1860+
description: The picture their identity provider gave, when it gave one.
18281861
BotPage:
18291862
type: object
18301863
required: [bots, nextCursor]
@@ -2827,6 +2860,69 @@ components:
28272860
isolationActive: false
28282861
isolationOffReason: null
28292862
nextCursor: null
2863+
BotPageOrganization:
2864+
summary: >-
2865+
Every Bot in the organization, for an admin: two people's own copies
2866+
of the same Bot, each named with its owner.
2867+
value:
2868+
bots:
2869+
- id: 7c1e2a90-5d3b-4f6e-9a18-2b4c6d8e0f13
2870+
name: General Assistant
2871+
title: Everyday Work
2872+
roleDescription: Help with everyday work using clear, concise, and accurate answers.
2873+
avatarSeed: general-assistant
2874+
visibility: private
2875+
hidden: false
2876+
pinned: false
2877+
systemOwned: false
2878+
packageBotId: general-assistant
2879+
endpoint: null
2880+
hasAuth: false
2881+
hasCallbackToken: false
2882+
isolated: false
2883+
framework: OpenBot
2884+
canManage: true
2885+
mine: true
2886+
owner:
2887+
id: user_2b8kq4
2888+
name: Ada Okafor
2889+
email: ada@example.com
2890+
image: null
2891+
assignedToMe: false
2892+
builtIn: true
2893+
runsOnOpenBotModel: true
2894+
keyFromOpenBot: true
2895+
isolationActive: false
2896+
isolationOffReason: null
2897+
- id: 3f9d4b21-8e6a-4c07-b2d5-91a7e3c0f468
2898+
name: General Assistant
2899+
title: ''
2900+
roleDescription: ''
2901+
avatarSeed: general-assistant
2902+
visibility: private
2903+
hidden: false
2904+
pinned: false
2905+
systemOwned: false
2906+
packageBotId: null
2907+
endpoint: null
2908+
hasAuth: false
2909+
hasCallbackToken: false
2910+
isolated: false
2911+
canManage: false
2912+
mine: false
2913+
withheld: true
2914+
owner:
2915+
id: user_7h3mz1
2916+
name: Sam Rivera
2917+
email: sam@example.com
2918+
image: https://images.example.com/sam.png
2919+
assignedToMe: false
2920+
builtIn: false
2921+
runsOnOpenBotModel: false
2922+
keyFromOpenBot: false
2923+
isolationActive: false
2924+
isolationOffReason: null
2925+
nextCursor: null
28302926
StarterBot:
28312927
summary: A Bot that comes with OpenBot.
28322928
value:

‎app/src/lib/api/generated/bots/bots.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const getListBotsUrl = (
116116
};
117117

118118
/**
119-
* Return one page of the Bots the caller can see: theirs, the ones shared with them, the ones assigned to them and the ones that come with OpenBot, oldest first, and by id among Bots made at the same moment. Somebody else's private Bot is never among them, an admin's list included. hidden=true lists only the Bots the caller hid from their own list instead. scope=organization lists every Bot in the organization, people's private Bots included, for an admin's screens that decide what Bots may hold; it is refused to anybody who is not an admin of the organization. Somebody else's private Bot comes withheld there: its name and avatar, and nothing from inside it (see the Bot's withheld). A missing cursor starts at the first page and nextCursor null ends the list.
119+
* Return one page of the Bots the caller can see: theirs, the ones shared with them, the ones assigned to them and the ones that come with OpenBot, oldest first, and by id among Bots made at the same moment. Somebody else's private Bot is never among them, an admin's list included. hidden=true lists only the Bots the caller hid from their own list instead. scope=organization lists every Bot in the organization, people's private Bots included, for an admin's screens that decide what Bots may hold; it is refused to anybody who is not an admin of the organization. Somebody else's private Bot comes withheld there: its name and avatar, and nothing from inside it (see the Bot's withheld). Every Bot a person owns comes with its owner there (see the Bot's owner). A missing cursor starts at the first page and nextCursor null ends the list.
120120
* @summary List Bots
121121
*/
122122
export const listBots = async (

0 commit comments

Comments
 (0)