From f7ca6b7ced3407c2f8a65d3fc97b7101b385665e Mon Sep 17 00:00:00 2001 From: Phelipe Lorran <112786693+httpsphl@users.noreply.github.com> Date: Mon, 5 Oct 2026 13:07:05 -0300 Subject: [PATCH] feat(tools): read and edit another crew's files with the owner's OK ask_crew_access now takes read and edit besides talk. With access, a bot lists, reads and writes the other crew's files through crew_files, read_crew_file and write_crew_file, never its own file tools, which the fences still keep out. One bot reaches that bot's folder and its crew's work folder; the whole crew reaches every bot's folder. The bots' memory, rules and the owner's attachments stay out of reach, so no crew can give another crew's bots instructions. The details list says what each access allows. Spec 10, 10.4. --- app/src/features/bots/CrewAccessList.tsx | 12 +- app/src/features/chat/CrewAccessCard.tsx | 8 +- app/src/features/chat/crewAccess.test.tsx | 7 +- app/src/i18n/en/bots.ts | 1 + app/src/i18n/en/chat.ts | 2 + app/src/i18n/es/bots.ts | 1 + app/src/i18n/es/chat.ts | 2 + app/src/i18n/pt-BR/bots.ts | 1 + app/src/i18n/pt-BR/chat.ts | 2 + app/src/lib/fakeCrewAccess.ts | 10 +- app/src/lib/protocol.gen.ts | 12 + .../botloft-core/src/protocol/crew_access.rs | 6 + .../migrations/0022_crew_access_files.sql | 3 + crates/botloft-store/src/crew_access.rs | 71 ++++- crates/botloft-store/src/lib.rs | 2 +- crates/botloft-store/src/migrate.rs | 1 + crates/botloftd/src/service/crew_access.rs | 128 ++++++--- crates/botloftd/src/service/files/foreign.rs | 118 ++++++++ crates/botloftd/src/service/files/mod.rs | 4 + crates/botloftd/src/tools/calls.rs | 37 ++- crates/botloftd/src/tools/catalog.rs | 1 + crates/botloftd/src/tools/crew_access.rs | 151 +++++----- crates/botloftd/src/tools/crew_reach.rs | 258 ++++++++++++++++++ crates/botloftd/src/tools/mod.rs | 1 + crates/botloftd/src/workspace/files.rs | 8 +- crates/botloftd/tests/crew_files.rs | 195 +++++++++++++ crates/botloftd/tests/mcp.rs | 5 +- docs/spec.md | 10 +- 28 files changed, 904 insertions(+), 153 deletions(-) create mode 100644 crates/botloft-store/migrations/0022_crew_access_files.sql create mode 100644 crates/botloftd/src/service/files/foreign.rs create mode 100644 crates/botloftd/src/tools/crew_reach.rs create mode 100644 crates/botloftd/tests/crew_files.rs diff --git a/app/src/features/bots/CrewAccessList.tsx b/app/src/features/bots/CrewAccessList.tsx index e0bb7dc9..3a0fc4a2 100644 --- a/app/src/features/bots/CrewAccessList.tsx +++ b/app/src/features/bots/CrewAccessList.tsx @@ -64,7 +64,17 @@ export function CrewAccessList({ bot }: { bot: Bot }) { className="flex items-center gap-2 rounded-lg border border-line bg-sunken py-1.5 pr-1 pl-2.5" > - {what} + + {what} + + {[ + access.talk && words.crewsKinds.talk, + access.edit ? words.crewsKinds.edit : access.read && words.crewsKinds.read, + ] + .filter(Boolean) + .join(" · ")} + +