feat: MCP permission tools + rail reorder, image cropping, faster member loading#115
Conversation
Adds the permission surface to the in-app MCP client (mcp_tools.dart):
Read group:
- list_roles — list a space's roles with their permission sets
- list_permissions — enumerate all known permission ids + descriptions
(local, no connection needed — lets an agent discover valid strings)
Manage group (privileged, off by default like moderate):
- create_role / update_role / delete_role
- add_member_role / remove_member_role
- list_channel_permissions / set_channel_permission /
delete_channel_permission — per-channel role/member allow/deny overwrites
(PUT/DELETE /channels/{id}/permissions/{target_id})
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- _updateRole: guard against empty string name being sent to the API when the caller passes `name: ""` explicitly; now returns an error instead of forwarding a blank role name - _listPermissions: drop unnecessary async (no await) — use Future.value expression body consistent with other pure handlers - Add test/features/developer/mcp_tools_test.dart covering tool registration groups, list_permissions output, update_role validation, set_channel_permission target_type validation, and not-connected behaviour for all network-bound manage tools https://claude.ai/code/session_018dziXgcBzX4ppj7Fed1UY1
Code review — findings and fixes (commit
|
… open-in-rail Bundles the in-flight working-tree changes: - Member roster loading: members.list gains a `withUser` flag (server embeds the user object in one batched query); the controller falls back to a bounded-concurrency (8) user backfill for older servers, and message rendering skips the roster load unless the message contains a mention. - Space rail: drag-reorder with insertion gaps between items, reordering within and across folders (moveSpaceToFolder gains a `before` anchor). - Image cropping: new shared showImageCropDialog (crop_your_image) with a pan/zoom frame; wired into avatar (circular 1:1), space icon and banner (16:9) editing. - Admin: open a space directly in the rail via `/spaces?space=<id>` using the admin's own connection instead of a public join. - Error reporting: navigation breadcrumbs driven off persisted space/channel selection (avoids a settings->reporting dependency cycle). - Open-tab strip: keep a tab's captured label in sync on channel rename. - Developer/MCP: surface the new `manage` permission group in settings + the developer settings page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ch tests create_role now reports not-connected before name validation; update_role validates fields before the connection check. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Bundles the current in-flight working-tree changes across the client and accordkit.
MCP / developer tooling
mcp_tools.dart):list_roles,list_permissions(local enum of valid permission ids + descriptions)moderate):create_role,update_role,delete_role,add_member_role,remove_member_role, and per-channel overwriteslist_channel_permissions/set_channel_permission/delete_channel_permissionmanagepermission group in settings + the developer settings pageupdate_role) andmcp_toolstestsMember roster loading
members.listgains awithUserflag — the server embeds each member'suserobject in one batched query, so the controller skips the per-member fetch. Older servers ignore the flag and fall back to a bounded-concurrency (8) user backfill instead of one request per member.Space rail
moveSpaceToFoldergains abeforeanchor for precise placement.Image cropping
showImageCropDialog(crop_your_image) with a pan/zoom frame, wired into avatar (circular 1:1), space icon, and banner (16:9) editing.Admin
/spaces?space=<id>using the admin's own connection, rather than a public member-join.Misc
Test plan
flutter analyze --no-fatal-infosclean on touched filesdart testinpackages/accordkit(memberswithUserendpoint test added)mcp_toolstests added for the new permission tools🤖 Generated with Claude Code