# Complete a linked Drive file handoff locally

AX070 v1. Download `drive-linked-handoff.mjs` into the same folder as your local script. Requires Node 18+ or a browser with ES modules; no packages, login or Google access. Inputs and returned text stay with the caller. Protect private links and output files.

`buildDriveLinkedHandoff(expected, actual, project, recipient)` returns either `{ ok: true, output, count }` or `{ ok: false, error }`. The expected list has one exact filename per line; the actual list has a filename, a tab and its Drive/Docs file URL per line, without headers. Names match after trimming and retain case. Resolve missing, unexpected or duplicate names and duplicate file IDs before a draft is produced. Folder links are rejected.

This checks names and URL shape only. It does not fetch links, inspect contents, establish permissions, upload files or send a message. Verify the recipient can open each intended file, then paste the output into your existing document or email editor. Useful completion and repeat use require separate user evidence; downloads and fictional examples are not that evidence.

## Executable fictional example

Save this as `example.mjs` alongside the downloaded module and run `node example.mjs`:

```js
import { buildDriveLinkedHandoff } from './drive-linked-handoff.mjs';
const expected = 'Brief.docx\nArtwork.png';
const actual = 'Brief.docx\thttps://docs.google.com/document/d/FICTIONAL_BRIEF/edit\nArtwork.png\thttps://drive.google.com/file/d/FICTIONAL_ART/view';
const result = buildDriveLinkedHandoff(expected, actual, 'Fictional launch kit', 'Project team');
if (!result.ok) throw Error(result.error);
if (result.count !== 2 || !result.output.includes('FICTIONAL_BRIEF') || !result.output.includes('FICTIONAL_ART')) throw Error('Incomplete fictional handoff');
console.log(result.output);
```

The fictional URLs are format examples, not available files. A missing name, duplicate file ID under a different URL, unsupported URL or control character must return `ok: false`, with no partial handoff output. The browser job uses the same core: https://bulldo.gs/jobs/drive-linked-handoff/?via=llms . Compare it with your normal manual link-list review; no time advantage is established.

## License

MIT License

Copyright (c) 2026 QuasiLife

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
