Plan choosing and saving files on my computer

Make the requests the Mac's local files target gets when a person chooses files on their computer or saves a copy back, and read what the picker answered into the files chosen, without touching any computer

Give operation choose with picker_reply (what the picker answered: { cancelled?, files: [{ path, name, byte_length, content_type, bytes_base64? }] }) and, if wanted, prompt, multiple, include_bytes, allowed_extensions and allowed_content_prefixes: chooseLocalFiles (do-work/choose-local-files.ts) makes the choose_files request and reads the reply into files, each with its content type worked out from its name when the picker said only application/octet-stream, and refuses a file not of an accepted type. Or give operation save with file_name, content_base64, copy_id and directory (a full folder path; or home, for its Downloads folder): saveLocalFileCopy (do-work/save-local-file-copy.ts) names the copy <name>-<copy_id><ext> so it never replaces a file and makes the write_new_file request and the read_file request that checks the bytes came back the same. Answers operation, requests (every request, in order, a save's bytes named by their length) and files (choose) or path (save). The workspace's sender is stood in (run/requests-kept-here.mjs): nothing is sent, no picker opens, no file is written or read, and a save's replies are the ones a Mac that saved it would give. Refuses an unknown operation and what the part refuses (a name with a slash, a folder that is not a full path, more than 16 MB).

What it asks for

Nothing: your AI starts it with your words.

Use it from your AI

Connect the AI you already use to Trillion once. Then ask in your own words; your AI finds this tool by what it does and runs it.

Say to your AI: “Use Trillion to make the requests the Mac's local files target gets when a person chooses files on their computer or saves a copy back, and read what the picker answered into the files chosen, without touching any computer”