Repository navigation
Commit e67a76d
authored
Show each app's state on a Bot for the person looking, and let them ask for access (#814)
* Share enabling a Composio app and a Shared grant's approval with other callers
Moves the body of POST /composio/apps into enableComposioApp and the Shared-approval rule of POST /grants into sharedGrantApproval, unchanged, so approving an access request can switch an app on and grant it through the same code.
* Say what each app on a Bot is for the person looking, and let them ask an administrator for the rest
GET /api/plugins/for/:agentId/apps and /apps/:app answer one of six states per app (ready, not_connected, reconnect, shared_not_connected, disabled, not_granted) from the tables the call gates read. Migration 0057 adds app_access_requests: a person files enable, grant or connect_shared as the state dictates, deduplicated by a partial unique index; an administrator approves by doing the change, or dismisses. Every step and refusal is audited as app_access.*.
* Browser queries and mutations for app access and access requests
* Document per-person app states and access requests
* Show each app's state and next step for you on a Bot's page
A Bot's Granted list now names each app by its own name and says what it is for the person looking — ready, not connected, needs reconnecting, waiting on the team account, turned off, or not given to this Bot — with Connect, Reconnect, Request access or Requested beside it. One piece draws the state and the action so the chat card can reuse it. Connect starts the same connect route Settings uses, in a new tab, lifted out of ConnectAppCard; key apps and Composio reconnects go to the app's Settings page. AppAccess gains connectedAt, the time the account the app runs in was connected.
* List access requests for administrators to approve or dismiss
An app's admin page has a Requests section, and the Plugins list shows every pending request at the top with a count on each app's row, so a request for an app nobody has switched on is still seen. Approve does what was asked; when the server cannot finish (a token to add, a team account to connect) its reason is shown on the request, which stays pending. Requests name who asked; nobody's connections are shown.
* Draw an app card in chat for every way a Bot cannot use an app
Refusals for a Shared app with no team account and for an account Composio no longer holds now carry the same structured prompt as the connect refusal, with a reason, the refusing Bot and (for a lost account) when. A new show_app_access tool, held by every Bot, answers with that prompt for an app that is switched off or not granted, and the guidance tells the Bot to call it instead of only naming an administrator. The transcript draws all of them as one card that reads the app's live state for this person on that Bot, using the shared state piece; a lost account is shown as Reconnect until a connection newer than the refusal appears. The card is never folded into the tool group.
* Describe app states on the Bot page, the chat card and access requests
* Leave Composio apps off Connected accounts when the deployment has no Composio key
* Say a Composio app is not available yet, rather than naming the key, on its account page
* Test Connected accounts on a deployment with no Composio key
* Note Connected accounts on a deployment with no Composio key in the changelog
* Let React finish before tearing down the Composio account test's browser
* Keep the Pydantic AI harness on anthropic 1.x
* Hand the active broker to enableComposioApp from both of its callers
The merge with main left enableComposioApp needing the active provider and
vendor. The Plugins route and the access-request approve route now both pass
them, and the app-access route test builds its store and shared-use store for
Composio explicitly.
* Build the app-access route test's broker with stubBroker
The hand-written broker answered revokeAccount with a silent no-op, which the
broker-stub ratchet refuses. It is now built by stubBroker with Composio's own
declarations, revokeAccount is left unprovided, and every test checks that no
unprovided member was reached. The personal connections it seeds also carry a
vendor id distinct from the local one, as the fixture-identity guard asks.
* Give the vendor-gone personal fixture its own vendor id
The account-gone test OB-05 added seeded a personal connection with the same
value as local and vendor id, one more collapse than the fixture-identity
guard allows for this file.
* Assert the missing approve body on its own, not as an undefined key
toEqual passes over an expected key whose value is undefined, so body:
undefined asserted nothing. The fetch recorder now leaves body out when none
was sent, and the test checks that the first approval has no body property.
* Re-key two allow-listed composio-adapter assertions after the merge
The two listActions assertions main allow-lists at composio-adapter lines 5412
and 5458 now sit at 5427 and 5473, because OB-05 added fifteen lines of tests
above them. They are the same offences, still owned by the fix cycle.
* Format the enableComposioApp refusal the merge resolution left long
* Read app access through the store's broker, not Composio by name
The app-access store compared provenance and the connection provider to
"composio", built composio:// urls and composio- ids by hand, and called
Composio's own url parser, so on an Arcade deployment every Arcade app read as
a custom server that was always ready. It now asks the store's broker
provider, BROKERED_PROFILE for the scheme and id prefix, and
toolkitOfFor(provider, url), and the state rule asks brokeredProvenance(). A
personal Arcade app is therefore not_connected until that person connects it,
switched off without an Arcade key, and an app only the directory knows gets
the arcade- id enabling would mint. Slugs are matched as typed before being
lowercased, so Arcade's case-sensitive toolkit names can be found. An app's
provider is now composio or arcade on the wire, and the approve refusal names
the active vendor and its key. Composio deployments read exactly as before.
* Declare authorizesPerAction in the unconfigured-Composio page fixture
Main made authorizesPerAction a required field of PluginsPage. The fixture
OB-05 added gives Composio's answer, false.
* Approve with read-only actions, claim a request before acting, and work an app's state out for the account its calls use
Approving with no refs now grants only the app's read-only actions, and refuses an app that has none. The request is claimed by the approving administrator before anything changes, so a dismissal or withdrawal meanwhile loses rather than leaving a grant under a dismissed request; an approval that cannot be carried out puts it back. On somebody else's published Team Bot the state follows the owner's account where the owner has one, and says when the first call will ask the person to allow their own. A Shared app whose audience the gate would refuse reads shared_not_approved. A name matches enabled apps before catalogue entries. Requests cap their names at 200 characters, refuse to enable an id nothing vouches for, and stop at 20 waiting per person.
* Forget a Composio account once a call finds the vendor no longer holds it
* Mark a connection withdrawn when the vendor refuses its refresh token
* Say a Memory source's app refusal in words instead of storing the card's marker
* Stop the Bot route fixture replacing the whole active-bot module for every file
* Draw the new app-access states, keep model text off screen, and end the sign-in wait when its tab closes
* Note read-only approvals, Team Bot accounts and lost connections in the changelog
* Answer authorizationId: null from the app-access test broker
Once the stub declares authorizations: null it is a broker literal the pairing
guard reads, and a broker with no authorization flow answers a mint with
authorizationId: null.
* Give the app-access test's directory apps the counts main added
BrokerApp gained classifiedCount, permissionCount and scopedActionCount on
main, and typecheck:tests reported the directory fixtures as missing them.
They are null here, as an app whose actions were never classified.
* Fill the new AppAccess fields in the app-access tool's fixture
The review fixes added unavailable, accountHolder and asksFirst to AppAccess,
and typecheck:tests reported the tool test's fixture as missing them.
* Say composio_unconfigured covers either broker in the app's type note1 parent f1961c3 commit e67a76d
66 files changed
Lines changed: 18714 additions & 349 deletions
File tree
- app
- src
- components
- bot-profile
- channels
- plugins
- lib
- app-access
- plugins
- routes/_authed
- admin/plugins
- settings/connected-accounts
- tests
- docs
- plugins
- server
- drizzle
- meta
- src
- db/schema
- memory
- plugins
- plugin-store
- route-groups
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
34 | 67 | | |
35 | 68 | | |
36 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
| |||
147 | 159 | | |
148 | 160 | | |
149 | 161 | | |
150 | | - | |
151 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
152 | 175 | | |
153 | 176 | | |
154 | 177 | | |
155 | 178 | | |
156 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
157 | 182 | | |
158 | 183 | | |
159 | 184 | | |
160 | 185 | | |
161 | 186 | | |
162 | 187 | | |
163 | 188 | | |
164 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
165 | 199 | | |
| 200 | + | |
166 | 201 | | |
167 | 202 | | |
168 | | - | |
| 203 | + | |
169 | 204 | | |
170 | 205 | | |
171 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
172 | 212 | | |
173 | 213 | | |
174 | 214 | | |
175 | 215 | | |
176 | 216 | | |
177 | 217 | | |
178 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
179 | 260 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 261 | + | |
| 262 | + | |
192 | 263 | | |
193 | 264 | | |
194 | 265 | | |
195 | 266 | | |
196 | 267 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 268 | + | |
201 | 269 | | |
202 | 270 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
208 | 278 | | |
209 | 279 | | |
210 | 280 | | |
211 | 281 | | |
212 | 282 | | |
213 | 283 | | |
214 | 284 | | |
215 | | - | |
| 285 | + | |
216 | 286 | | |
217 | 287 | | |
218 | 288 | | |
| |||
232 | 302 | | |
233 | 303 | | |
234 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
0 commit comments