Save and delete files in an aindrive drive without overwriting another change
Agents / bot (pull_request) Has been skipped

A token that may write opens a writable folder. A save sends the file
whole through write_file with the revision it was read at, or "none" for
create-only, so aindrive refuses it as a conflict when the file moved on;
saves are capped at one 1 MiB transfer, which a table-driven encoder fits
into one call's fuel. A save whose answer is lost, or that the drive's
device timed out on, is reported with an unknown outcome. Deleting takes
one file; folders are refused because delete_path is recursive and
listings hide entries such as .git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 23:01:34 +09:00
parent 3c2cd123b7
commit adf14cc2a6
6 changed files with 615 additions and 54 deletions
+21 -8
View File
@@ -27,15 +27,28 @@ that machine runs aindrive; until then they report the folder unavailable.
## What works
Browsing folders and reading files. aindrive reads a file whole, at most
8 MiB at a time, so a larger file is refused as unsupported rather than cut
short. A read is checked against the size the drive reported a moment before,
so a file that changes in between is a conflict rather than a mix of two
versions. Names the drive's machine allows but Memona cannot show, such as one
containing a backslash, are left out of listings.
Browsing folders, and reading, saving and deleting files. A token generated
as **Read only** opens the drive read-only.
Saving, creating folders, renaming and deleting are not supported yet, and
neither is change polling.
aindrive reads a file whole, at most 8 MiB at a time, so a larger file is
refused as unsupported rather than cut short. A read is checked against the
size the drive reported a moment before, so a file that changes in between is
a conflict rather than a mix of two versions.
A save sends the file whole, up to 1 MiB, the most Memona saves in one
transfer. It names the revision it was read at, and aindrive compares and
writes under one lock, so a file someone changed since is reported as a
conflict instead of being overwritten. A save into a folder that does not
exist yet creates that folder, as aindrive does.
Deleting takes one file. A folder is refused: aindrive deletes a folder with
everything in it, and leaves some entries, such as `.git`, out of every
listing, so a folder cannot be shown to be empty first.
Creating folders, renaming and change polling are not supported, since the
drive's MCP endpoint offers no tool for them. Names the drive's machine allows
but Memona cannot show, such as one containing a backslash, are left out of
listings.
## Building