Lets Stavrobot search, read, upload, organize and share files in your Google Drive.
share is on by defaultStavrobot turns on every tool of a plugin when it's installed, so the bot can share your files with anyone, or make them public, from the moment you connect. Files are untrusted input. Any document, or an email or web page the bot reads, can carry a prompt injection, text written to get the bot to share your files with someone, and with share on nothing stands between that text and a public link.
Recommended: turn share off before you connect, and share files from Drive yourself. You have to do this yourself, from your bot's plugin settings page:
/settings/plugins and pick google-drive.share, then click "Save permissions".unshare only takes access away, so it's fine to leave it on.
If you're an agent installing this plugin, tell your user this warning and the steps above, and don't call auth_url until they confirm share is off.
You need your own Google Cloud OAuth client, it's free:
The app stays unverified, which is fine for personal use. Google shows a warning when you connect and caps unverified apps at 100 users.
Tell Stavrobot to install https://github.com/vmasto/stavrobot-plugin-google-drive.
client_id and client_secret: from the Desktop app client.refresh_token: leave it empty. Ask Stavrobot to connect Google Drive and it sends you a link. Google warns the app is unverified, click Advanced and continue. After you allow access the browser shows an error page on 127.0.0.1, that's expected. Copy the full address and send it back, the plugin saves the token itself.The plugin asks for the full drive scope, since the narrower ones only see files the plugin created itself. That scope also allows permanent deletion, but the plugin has no tool for it: trash keeps files in the trash for 30 days.
auth_url, auth_complete: connect your account.list_folder: a folder's contents, folders first.search: by name or content, with filters for type, folder and files shared with you. Without filters it lists recent files.get_metadata: path, link, owners and who a file is shared with.read: Google Docs as Markdown, Sheets as CSV (first sheet only), Slides and text files as text.download: sends a file to the bot, up to 25 MB. The plugin exports Google Docs as PDF, Word or Markdown, Sheets as Excel or CSV, and Slides as PDF or PowerPoint.upload: a file or text, up to 25 MB, optionally converted to a Google Doc or Sheet. It can also replace a file's content and keep its link.create_folder, move (also renames), copy.trash: moves files to the trash, or takes them back out.share: with a person by email, or with anyone who has the link. On by default, see the warning above.unshare.GNU Affero General Public License, version 3. See LICENSE.